Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
1,085.532765277777777751 C404
Holders
74
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
3.198198560149051801 C404Value
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
C4sh404
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// Telegram: https://t.me/C4SH_404 // Twitter: https://twitter.com/C4SH404 // Doc: https://c4sh-404.gitbook.io/c4sh-404/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Strings.sol"; import "./Ownable.sol"; import "./DN404.sol"; import "./DN404Mirror.sol"; import "./SafeTransferLib.sol"; contract C4sh404 is DN404, Ownable { mapping(uint8 => string) public baseTokenURI; mapping(uint8 => string) public imageTokenURI; mapping(address => bool) public stakingAddresses; uint256[] private rarityThresholds; uint256 private nftCountPerTier; constructor() Ownable(msg.sender) { _setSkipNFT(msg.sender, true); _setSkipNFT(address(0xC36442b4a4522E871399CD717aBDD847Ab11FE88), true); // NonfungiblePositionManager _setSkipNFT(address(0x1F98431c8aD98523631AE4a59f267346ea31F984), true); // V3 factory _setSkipNFT(address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f), true); // V2 factory _setSkipNFT(address(0xEa07DdBBeA804E7fe66b958329F8Fa5cDA95Bd55), true); // Sablier V2 _setSkipNFT(address(0x7CC7e125d83A581ff438608490Cc0f7bDff79127), true); // SablierV2LockupDynamic baseTokenURI[ 1 ] = "ipfs://bafybeifwe5llyuz7ibnwowcgnmlpwhkmtthg4ksvyb5c6tif4zl4rpshiq/"; baseTokenURI[ 2 ] = "ipfs://bafybeienjbgy6yhx4v5ljhlju4fayubgpeow66brrf3wevympfkf3zy3em/"; baseTokenURI[ 3 ] = "ipfs://bafybeib3whb6jj5r4gm34y2xpdewu3j6udzd4xukdi3v26payogqnnouqu/"; baseTokenURI[ 4 ] = "ipfs://bafybeifi7d5ca4ib4updkd7lei2dztofdmdmft3qhhq4uolafqqhbpaoyu/"; baseTokenURI[ 5 ] = "ipfs://bafybeibpx7wngzgt3gtlvyjijpk3b5eegk3x3jq5o6ykn4avitw6abslli/"; imageTokenURI[ 1 ] = "ipfs://bafybeict7mrafrcr5a6322jsixxwqd3b6oyzsgkhoruyncm2kqoj2lmrrm/"; imageTokenURI[ 2 ] = "ipfs://bafybeiap3bzcb3l244bf4llfamhykhycnsnymxw2owuut2jo46vgmncmdy/"; imageTokenURI[ 3 ] = "ipfs://bafybeic2y4q4infxcyqrbsq27dzbqmbaxavxxiastxkqyhrfzrhce7h7dq/"; imageTokenURI[ 4 ] = "ipfs://bafybeigvtjzh74gs2ygpceuwv2m33q7o4d5kakvtc3bylpkxte5c5rqdku/"; imageTokenURI[ 5 ] = "ipfs://bafybeidskwceyif4ieasbibzgpgmrk7j3vhgho652cjpfgfubepsbshbqe/"; rarityThresholds = [5500, 3000, 1000, 460, 40]; nftCountPerTier = 187; address mirror = address(new DN404Mirror(msg.sender)); _initializeDN404(1000 * _WAD, msg.sender, mirror); _setTradingEnabled(false); _setTaxSettings( address(0xc7570dd89c04B2213D9044302CdB303FC2Dc0786), (1000 * _WAD * 50) / 10000 ); _setTaxRates(50, 50); _setLimits(true, (1000 * _WAD) / 100); // 1% } function name() public pure override returns (string memory) { return "C4SH404"; } function symbol() public pure override returns (string memory) { return "C404"; } function tokenURI( uint256 tokenId ) public view override returns (string memory result) { (uint8 tier, uint256 number) = getNFTInfo(tokenId); return string.concat( baseTokenURI[tier], Strings.toString(number), ".json" ); } function setApprovalStakingAddress( address stakingAddress, bool approved ) external { _setApprovalForAll(stakingAddress, approved, msg.sender); } function getNFTInfo(uint256 id) public view returns (uint8, uint256) { uint256 seed = uint256(keccak256(abi.encodePacked(id))); uint256 rand = seed % 10000; uint256 cumulative = 0; for (uint8 i = 0; i < rarityThresholds.length; i++) { cumulative += rarityThresholds[i]; if (rand < cumulative) { return (i + 1, seed % nftCountPerTier); } } return (uint8(rarityThresholds.length), seed % nftCountPerTier); } function mint(address to, uint256 amount) public { require(stakingAddresses[msg.sender], "Not staking address"); _mint(to, amount); } function setTokenURI(uint8 tier, string memory _tokenURI) public onlyOwner { baseTokenURI[tier] = _tokenURI; } function setImageURI(uint8 tier, string memory _imageURI) public onlyOwner { imageTokenURI[tier] = _imageURI; } function setNftCountPerTier(uint256 _nftCountPerTier) public onlyOwner { nftCountPerTier = _nftCountPerTier; } function enableTrading(bool _isTradingEnabled) public onlyOwner { _setTradingEnabled(_isTradingEnabled); } function setLimits(bool _isLimited, uint256 _maxMint) public onlyOwner { _setLimits(_isLimited, _maxMint); } function setSkipNFT(address nft, bool skip) public onlyOwner { _setSkipNFT(nft, skip); } function setStakingAddress( address _stakingAddress, bool temp ) public onlyOwner { stakingAddresses[_stakingAddress] = temp; _setSkipNFT(_stakingAddress, temp); } function setTaxSettings( address receiver, uint256 swapThreeshold ) public onlyOwner { _setTaxSettings(receiver, swapThreeshold); } function setTaxPair(address pair) public onlyOwner { _setTaxPair(pair); _setSkipNFT(pair, true); } function setTaxRates(uint256 buy, uint256 sell) public onlyOwner { _setTaxRates(buy, sell); } function setExcludedFromFee( address account, bool excluded ) public onlyOwner { _setExcludedFromFee(account, excluded); } function setSwapEnabled(bool enabled) public onlyOwner { _setSwapEnabled(enabled); } function withdraw() public onlyOwner { SafeTransferLib.safeTransferAllETH(msg.sender); } }
// 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; interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } /// @title DN404 /// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints /// and burns NFTs based on an account's ERC20 token balance. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in this base DN404 contract, however a /// DN404Mirror contract ***MUST*** be deployed and linked during /// initialization. abstract contract DN404 { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when `amount` tokens is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`. event Approval( address indexed owner, address indexed spender, uint256 amount ); /// @dev Emitted when `target` sets their skipNFT flag to `status`. event SkipNFTSet(address indexed target, bool status); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when attempting to double-initialize the contract. error DNAlreadyInitialized(); /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance. error InsufficientBalance(); error MaxBalanceExceeded(); error TradingNotActive(); /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance. error InsufficientAllowance(); /// @dev Thrown when minting an amount of tokens that would overflow the max tokens. error TotalSupplyOverflow(); /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract. error SenderNotMirror(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when the mirror address provided for initialization is the zero address. error MirrorAddressIsZero(); /// @dev Thrown when the link call to the mirror contract reverts. error LinkMirrorContractFailed(); /// @dev Thrown when setting an NFT token approval /// and the caller is not the owner or an approved operator. error ApprovalCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT /// and the caller is not the owner or an approved operator. error TransferCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT and the from address is not the current owner. error TransferFromIncorrectOwner(); /// @dev Thrown when checking the owner or approved address for an non-existent NFT. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ IUniswapV2Router02 internal constant UNISWAP_V2_ROUTER = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); /// @dev Amount of token balance that is equal to one NFT. uint256 internal constant _WAD = 10 ** 18; /// @dev The maximum token ID allowed for an NFT. uint256 internal constant _MAX_TOKEN_ID = 0xffffffff; /// @dev The maximum possible token supply. uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1; /// @dev The flag to denote that the address data is initialized. uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0; /// @dev The flag to denote that the address should skip NFTs. uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1; uint8 internal constant _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG = 1 << 2; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Auxiliary data. uint88 aux; // Flags for `initialized` and `skipNFT`. uint8 flags; // The alias for the address. Zero means absence of an alias. uint32 addressAlias; // The number of NFT tokens. uint32 ownedLength; // The token balance in wei. uint96 balance; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev Struct containing the base token contract storage. struct DN404Storage { bool limits; bool tradingEnabled; uint256 maxTokensAmountPerWallet; address owner; address taxReceiver; uint256 taxBuy; uint256 taxSell; uint256 taxSwapThreeshold; address pair; bool inSwap; bool swapEnabled; // Current number of address aliases assigned. uint32 numAliases; // Next token ID to assign for an NFT mint. uint32 nextTokenId; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalSupply; // Address of the NFT mirror contract. address mirrorERC721; // Mapping of a user alias number to their address. mapping(uint32 => address) aliasToAddress; // Mapping of user operator approvals for NFTs. mapping(address => mapping(address => bool)) operatorApprovals; // Mapping of NFT token approvals to approved operators. mapping(uint256 => address) tokenApprovals; // Mapping of user allowances for token spenders. mapping(address => mapping(address => uint256)) allowance; // Mapping of NFT token IDs owned by an address. mapping(address => Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_STORAGE")))`. $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404( uint256 initialTokenSupply, address initialSupplyOwner, address mirror ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.tradingEnabled = true; $.limits = false; $.maxTokensAmountPerWallet = 0; $.owner = initialSupplyOwner; $.taxReceiver = address(0); $.taxBuy = 0; $.taxSell = 0; $.taxSwapThreeshold = 0; $.pair = address(0); $.inSwap = false; $.swapEnabled = false; $.nextTokenId = 1; $.mirrorERC721 = mirror; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); AddressData storage initialOwnerAddressData = _addressData( initialSupplyOwner ); initialOwnerAddressData.balance = uint96(initialTokenSupply); emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); _setSkipNFT(initialSupplyOwner, true); } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* METADATA FUNCTIONS TO OVERRIDE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the name of the token. function name() public view virtual returns (string memory); /// @dev Returns the symbol of the token. function symbol() public view virtual returns (string memory); /// @dev Returns the Uniform Resource Identifier (URI) for token `id`. function tokenURI(uint256 id) public view virtual returns (string memory); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC20 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the decimals places of the token. Always 18. function decimals() public pure returns (uint8) { return 18; } /// @dev Returns the amount of tokens in existence. function totalSupply() public view virtual returns (uint256) { return uint256(_getDN404Storage().totalSupply); } /// @dev Returns the amount of tokens owned by `owner`. function balanceOf(address owner) public view virtual returns (uint256) { return _getDN404Storage().addressData[owner].balance; } /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`. function allowance( address owner, address spender ) public view returns (uint256) { return _getDN404Storage().allowance[owner][spender]; } /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// /// Emits a {Approval} event. function approve( address spender, uint256 amount ) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); $.allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @dev Transfer `amount` tokens from the caller to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// /// Emits a {Transfer} event. function transfer( address to, uint256 amount ) public virtual returns (bool) { _transfer(msg.sender, to, amount); return true; } /// @dev Transfers `amount` tokens from `from` to `to`. /// /// Note: Does not update the allowance if it is the maximum uint256 value. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`. /// /// Emits a {Transfer} event. function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); uint256 allowed = $.allowance[from][msg.sender]; if (allowed != type(uint256).max) { if (amount > allowed) revert InsufficientAllowance(); unchecked { $.allowance[from][msg.sender] = allowed - amount; } } _transfer(from, to, amount); return true; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL MINT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Mints `amount` tokens to `to`, increasing the total supply. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _mint(address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalSupply) + amount; if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) { revert TotalSupplyOverflow(); } $.totalSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = toAddressData.ownedLength; uint256 toEnd = toBalance / _WAD; _PackedLogs memory packedLogs = _packedLogsMalloc( _zeroFloorSub(toEnd, toIndex) ); if (packedLogs.logs.length != 0) { uint256 maxNFTId = $.totalSupply / _WAD; uint32 toAlias = _registerAndResolveAlias( toAddressData, to ); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex( $.oo, id, toAlias, uint32(toIndex++) ); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); _packedLogsSend(packedLogs, $.mirrorERC721); } } } emit Transfer(address(0), to, amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL BURN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Burns `amount` tokens from `from`, reducing the total supply. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Emits a {Transfer} event. function _burn(address from, uint256 amount) internal virtual { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalSupply = uint96(currentTokenSupply); Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = fromAddressData.ownedLength; uint256 nftAmountToBurn = _zeroFloorSub( fromIndex, fromBalance / _WAD ); if (nftAmountToBurn != 0) { $.totalNFTSupply -= uint32(nftAmountToBurn); _PackedLogs memory packedLogs = _packedLogsMalloc( nftAmountToBurn ); uint256 fromEnd = fromIndex - nftAmountToBurn; // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, address(0), amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL TRANSFER FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Moves `amount` of tokens from `from` to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _transfer( address from, address to, uint256 amount ) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); _TransferTemps memory t; t.fromOwnedLength = fromAddressData.ownedLength; t.toOwnedLength = toAddressData.ownedLength; t.fromBalance = fromAddressData.balance; if (amount > t.fromBalance) revert InsufficientBalance(); if (!$.tradingEnabled && from != $.owner && to != $.owner) revert TradingNotActive(); unchecked { t.fromBalance -= amount; } // Taxes uint256 taxAmount = 0; if ( $.tradingEnabled && $.taxBuy > 0 && from == $.pair && to != address(UNISWAP_V2_ROUTER) && toAddressData.flags & _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG == 0 ) { taxAmount = (amount * $.taxBuy) / 100; } if ( $.tradingEnabled && $.taxSell > 0 && to == $.pair && from != address(this) ) { taxAmount = (amount * $.taxSell) / 100; } if (taxAmount > 0) { AddressData storage contractData = _addressData(address(this)); contractData.balance = uint96(contractData.balance + taxAmount); amount -= taxAmount; uint256 contractTokenBalance = balanceOf(address(this)); if ( !$.inSwap && to == $.pair && $.swapEnabled && contractTokenBalance > $.taxSwapThreeshold ) { if (amount >= $.taxSwapThreeshold) { swapTokensForEth($.taxSwapThreeshold); } else { swapTokensForEth(amount); } } } unchecked { fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96( t.toBalance = toAddressData.balance + amount ); if ($.limits) { if (toAddressData.balance / _WAD > $.maxTokensAmountPerWallet) { revert MaxBalanceExceeded(); } } t.nftAmountToBurn = _zeroFloorSub( t.fromOwnedLength, t.fromBalance / _WAD ); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn; t.nftAmountToMint = _zeroFloorSub( t.toBalance / _WAD, t.toOwnedLength ); } _PackedLogs memory packedLogs = _packedLogsMalloc( t.nftAmountToBurn + t.nftAmountToMint ); if (t.nftAmountToBurn != 0) { Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); fromAddressData.ownedLength = uint32(fromEnd); // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); } if (t.nftAmountToMint != 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalSupply / _WAD; uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex( $.oo, id, toAlias, uint32(toIndex++) ); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); } if (packedLogs.logs.length != 0) { _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, to, amount); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Call must originate from the mirror contract. /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// `msgSender` must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function _transferFromNFT( address from, address to, uint256 id, address msgSender ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if (to == address(0)) revert TransferToZeroAddress(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (from != owner) revert TransferFromIncorrectOwner(); if (msgSender != from) { if (!$.operatorApprovals[from][msgSender]) { if (msgSender != $.tokenApprovals[id]) { revert TransferCallerNotOwnerNorApproved(); } } } AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); fromAddressData.balance -= uint96(_WAD); unchecked { toAddressData.balance += uint96(_WAD); _set( $.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to) ); delete $.tokenApprovals[id]; uint256 updatedId = _get( $.owned[from], --fromAddressData.ownedLength ); _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id))); _set($.owned[to], n, uint32(id)); _set($.oo, _ownedIndex(id), uint32(n)); } emit Transfer(from, to, _WAD); } function _setTradingEnabled(bool enabled) internal { DN404Storage storage $ = _getDN404Storage(); $.tradingEnabled = enabled; } function _setLimits( bool enabled, uint256 maxTokensAmountPerWallet ) internal { DN404Storage storage $ = _getDN404Storage(); $.limits = enabled; $.maxTokensAmountPerWallet = maxTokensAmountPerWallet; } function _setTaxSettings( address receiver, uint256 swapThreeshold ) internal { DN404Storage storage $ = _getDN404Storage(); $.taxReceiver = receiver; $.taxSwapThreeshold = swapThreeshold; } function _setSwapEnabled(bool enabled) internal { DN404Storage storage $ = _getDN404Storage(); $.swapEnabled = enabled; } function _setTaxPair(address pair) internal { DN404Storage storage $ = _getDN404Storage(); $.pair = pair; } function _setTaxRates(uint256 buy, uint256 sell) internal { DN404Storage storage $ = _getDN404Storage(); $.taxBuy = buy; $.taxSell = sell; } modifier lockTheSwap() { DN404Storage storage $ = _getDN404Storage(); $.inSwap = true; _; $.inSwap = false; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { DN404Storage storage $ = _getDN404Storage(); address[] memory path = new address[](2); path[0] = address(this); path[1] = UNISWAP_V2_ROUTER.WETH(); $.allowance[address(this)][address(UNISWAP_V2_ROUTER)] = tokenAmount; UNISWAP_V2_ROUTER.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address($.taxReceiver), block.timestamp ); } function getExcludedFromFee(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_EXCLUDED_FROM_FEE_FLAG != 0; } function _setExcludedFromFee(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_EXCLUDED_FROM_FEE_FLAG; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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 Internal function to set account `a` skipNFT flag to `state` /// /// Initializes account `a` AddressData if it is not currently initialized. /// /// Emits a {SkipNFTSet} event. function _setSkipNFT(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG; } emit SkipNFTSet(a, state); } /// @dev Returns a storage data pointer for account `a` AddressData /// /// Initializes account `a` AddressData if it is not currently initialized. function _addressData( address a ) internal virtual returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) { uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG; if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG; d.flags = flags; } } /// @dev Returns the `addressAlias` of account `to`. /// /// Assigns and registers the next alias if `to` alias was not previously registered. function _registerAndResolveAlias( AddressData storage toAddressData, address to ) internal virtual returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view virtual returns (address) { return _getDN404Storage().mirrorERC721; } /// @dev Returns the total NFT supply. function _totalNFTSupply() internal view virtual returns (uint256) { return _getDN404Storage().totalNFTSupply; } /// @dev Returns `owner` NFT balance. function _balanceOfNFT( address owner ) internal view virtual returns (uint256) { return _getDN404Storage().addressData[owner].ownedLength; } /// @dev Returns the owner of token `id`. /// Returns the zero address instead of reverting if the token does not exist. function _ownerAt(uint256 id) internal view virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); return $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; } /// @dev Returns the owner of token `id`. /// /// Requirements: /// - Token `id` must exist. function _ownerOf(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _ownerAt(id); } /// @dev Returns if token `id` exists. function _exists(uint256 id) internal view virtual returns (bool) { return _ownerAt(id) != address(0); } /// @dev Returns the account approved to manage token `id`. /// /// Requirements: /// - Token `id` must exist. function _getApproved(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _getDN404Storage().tokenApprovals[id]; } /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`. /// /// Requirements: /// - `msgSender` must be the owner or an approved operator for the token owner. function _approveNFT( address spender, uint256 id, address msgSender ) internal virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (msgSender != owner) { if (!$.operatorApprovals[owner][msgSender]) { revert ApprovalCallerNotOwnerNorApproved(); } } $.tokenApprovals[id] = spender; return owner; } /// @dev Approve or remove the `operator` as an operator for `msgSender`, /// without authorization checks. function _setApprovalForAll( address operator, bool approved, address msgSender ) internal virtual { _getDN404Storage().operatorApprovals[msgSender][operator] = approved; } /// @dev Calls the mirror contract to link it to this contract. /// /// Reverts if the call to the mirror contract reverts. function _linkMirrorContract(address mirror) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero( and( eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20) ) ) { mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`. revert(0x1c, 0x04) } } } /// @dev Fallback modifier to dispatch calls from the mirror NFT contract /// to internal functions in this contract. modifier dn404Fallback() virtual { DN404Storage storage $ = _getDN404Storage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `isApprovedForAll(address,address)`. if (fnSelector == 0xe985e9c5) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x44) revert(); address owner = address(uint160(_calldataload(0x04))); address operator = address(uint160(_calldataload(0x24))); _return($.operatorApprovals[owner][operator] ? 1 : 0); } // `ownerOf(uint256)`. if (fnSelector == 0x6352211e) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_ownerOf(id))); } // `transferFromNFT(address,address,uint256,address)`. if (fnSelector == 0xe5eb36c8) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x84) revert(); address from = address(uint160(_calldataload(0x04))); address to = address(uint160(_calldataload(0x24))); uint256 id = _calldataload(0x44); address msgSender = address(uint160(_calldataload(0x64))); _transferFromNFT(from, to, id, msgSender); _return(1); } // `setApprovalForAll(address,bool,address)`. if (fnSelector == 0x813500fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); bool status = _calldataload(0x24) != 0; address msgSender = address(uint160(_calldataload(0x44))); _setApprovalForAll(spender, status, msgSender); _return(1); } // `approveNFT(address,uint256,address)`. if (fnSelector == 0xd10b6e0c) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); uint256 id = _calldataload(0x24); address msgSender = address(uint160(_calldataload(0x44))); _return(uint160(_approveNFT(spender, id, msgSender))); } // `getApproved(uint256)`. if (fnSelector == 0x081812fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x04) revert(); _return(_totalNFTSupply()); } // `implementsDN404()`. if (fnSelector == 0xb7a94eb8) { _return(1); } _; } /// @dev Fallback function for calls from mirror NFT contract. fallback() external payable virtual dn404Fallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing packed log data for `Transfer` events to be /// emitted by the mirror NFT contract. struct _PackedLogs { uint256[] logs; uint256 offset; } /// @dev Initiates memory allocation for packed logs with `n` log items. function _packedLogsMalloc( uint256 n ) private pure returns (_PackedLogs memory p) { /// @solidity memory-safe-assembly assembly { let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`. mstore(logs, n) let offset := add(0x20, logs) mstore(0x40, add(offset, shl(5, n))) mstore(p, logs) mstore(add(0x20, p), offset) } } /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`. function _packedLogsAppend( _PackedLogs memory p, address a, uint256 id, uint256 burnBit ) private pure { /// @solidity memory-safe-assembly assembly { let offset := mload(add(0x20, p)) mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit)) mstore(add(0x20, p), add(offset, 0x20)) } } /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`. function _packedLogsSend(_PackedLogs memory p, address mirror) private { /// @solidity memory-safe-assembly assembly { let logs := mload(p) let o := sub(logs, 0x40) // Start of calldata to send. mstore(o, 0x263c69d6) // `logTransfer(uint256[])`. mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send. let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send. if iszero( and( eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20) ) ) { revert(o, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Returns the calldata value at `offset`. function _calldataload( uint256 offset ) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Executes a return opcode to return `x` and end the current call frame. function _return(uint256 x) private pure { /// @solidity memory-safe-assembly assembly { mstore(0x00, x) return(0x00, 0x20) } } /// @dev Returns `max(0, x - y)`. function _zeroFloorSub( uint256 x, uint256 y ) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mul(gt(x, y), sub(x, y)) } } /// @dev Returns `i << 1`. function _ownershipIndex(uint256 i) private pure returns (uint256) { return i << 1; } /// @dev Returns `(i << 1) + 1`. function _ownedIndex(uint256 i) private pure returns (uint256) { unchecked { return (i << 1) + 1; } } /// @dev Returns the uint32 value at `index` in `map`. function _get( Uint32Map storage map, uint256 index ) private view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function _set(Uint32Map storage map, uint256 index, uint32 value) private { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Sets the owner alias and the owned index together. function _setOwnerAliasAndOwnedIndex( Uint32Map storage map, uint256 id, uint32 ownership, uint32 ownedIndex ) private { /// @solidity memory-safe-assembly assembly { let value := or(shl(32, ownedIndex), and(0xffffffff, ownership)) mstore(0x20, map.slot) mstore(0x00, shr(2, id)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(id, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } }
// 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: UNLICENSED pragma solidity ^0.8.24; abstract contract Ownable { event OwnershipTransferred(address indexed user, address indexed newOwner); error Unauthorized(); error InvalidOwner(); address public owner; modifier onlyOwner() virtual { if (msg.sender != owner) revert Unauthorized(); _; } constructor(address _owner) { if (_owner == address(0)) revert InvalidOwner(); owner = _owner; emit OwnershipTransferred(address(0), _owner); } function transferOwnership(address _owner) public virtual onlyOwner { if (_owner == address(0)) revert InvalidOwner(); owner = _owner; emit OwnershipTransferred(msg.sender, _owner); } function revokeOwnership() public virtual onlyOwner { owner = address(0); emit OwnershipTransferred(msg.sender, address(0)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// /// @dev Note: /// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection. /// - For ERC20s, this implementation won't check that a token has code, /// responsibility is delegated to the caller. library SafeTransferLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ETH transfer has failed. error ETHTransferFailed(); /// @dev The ERC20 `transferFrom` has failed. error TransferFromFailed(); /// @dev The ERC20 `transfer` has failed. error TransferFailed(); /// @dev The ERC20 `approve` has failed. error ApproveFailed(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes. uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300; /// @dev Suggested gas stipend for contract receiving ETH to perform a few /// storage reads and writes, but low enough to prevent griefing. uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ETH OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants. // // The regular variants: // - Forwards all remaining gas to the target. // - Reverts if the target reverts. // - Reverts if the current contract has insufficient balance. // // The force variants: // - Forwards with an optional gas stipend // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases). // - If the target reverts, or if the gas stipend is exhausted, // creates a temporary contract to force send the ETH via `SELFDESTRUCT`. // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758. // - Reverts if the current contract has insufficient balance. // // The try variants: // - Forwards with a mandatory gas stipend. // - Instead of reverting, returns whether the transfer succeeded. /// @dev Sends `amount` (in wei) ETH to `to`. function safeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if iszero( call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00) ) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Sends all the ETH in the current contract to `to`. function safeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // Transfer all the ETH and check if it succeeded or not. if iszero( call( gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function forceSafeTransferETH( address to, uint256 amount, uint256 gasStipend ) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero( call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`. function forceSafeTransferAllETH(address to, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if iszero( call( gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero( call( GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // forgefmt: disable-next-item if iszero( call( GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) ) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function trySafeTransferETH( address to, uint256 amount, uint256 gasStipend ) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call( gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00 ) } } /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`. function trySafeTransferAllETH( address to, uint256 gasStipend ) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call( gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00 ) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC20 OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferFrom( address token, address from, address to, uint256 amount ) internal { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x60, amount) // Store the `amount` argument. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends all of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have their entire balance approved for /// the current contract to manage. function safeTransferAllFrom( address token, address from, address to ) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`. amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransfer(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sends all of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransferAll( address token, address to ) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, address()) // Store the address of the current contract. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x14, to) // Store the `to` argument. amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// Reverts upon failure. function safeApprove(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// If the initial attempt to approve fails, attempts to reset the approved amount to zero, /// then retries the approval again (some tokens, e.g. USDT, requires this). /// Reverts upon failure. function safeApproveWithRetry( address token, address to, uint256 amount ) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, retrying upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x34, 0) // Store 0 for the `amount`. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval. mstore(0x34, amount) // Store back the original `amount`. // Retry the approval, reverting upon failure. if iszero( and( or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Returns the amount of ERC20 `token` owned by `account`. /// Returns zero if the `token` does not exist. function balanceOf( address token, address account ) internal view returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x14, account) // Store the `account` argument. mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`. amount := mul( mload(0x20), and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20) ) ) } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "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":[],"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":"InvalidOwner","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MaxBalanceExceeded","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TradingNotActive","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","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":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTradingEnabled","type":"bool"}],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getExcludedFromFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getNFTInfo","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"imageTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mirrorERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revokeOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakingAddress","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalStakingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"setExcludedFromFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"string","name":"_imageURI","type":"string"}],"name":"setImageURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isLimited","type":"bool"},{"internalType":"uint256","name":"_maxMint","type":"uint256"}],"name":"setLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftCountPerTier","type":"uint256"}],"name":"setNftCountPerTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"bool","name":"skip","type":"bool"}],"name":"setSkipNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingAddress","type":"address"},{"internalType":"bool","name":"temp","type":"bool"}],"name":"setStakingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setSwapEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"}],"name":"setTaxPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"buy","type":"uint256"},{"internalType":"uint256","name":"sell","type":"uint256"}],"name":"setTaxRates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"swapThreeshold","type":"uint256"}],"name":"setTaxSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakingAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"result","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50338062000032576040516349e27cff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b03831690811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620000883360016200061c565b620000a973c36442b4a4522e871399cd717abdd847ab11fe8860016200061c565b620000ca731f98431c8ad98523631ae4a59f267346ea31f98460016200061c565b620000eb735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f60016200061c565b6200010c73ea07ddbbea804e7fe66b958329f8fa5cda95bd5560016200061c565b6200012d737cc7e125d83a581ff438608490cc0f7bdff7912760016200061c565b60405180608001604052806043815260200162004aa060439139600160008190526020527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f906200017f908262000a9e565b506040518060800160405280604381526020016200490e60439139600260005260016020527fd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f90620001d2908262000a9e565b5060405180608001604052806043815260200162004a1a60439139600360005260016020527f7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b9062000225908262000a9e565b5060405180608001604052806043815260200162004b2660439139600460005260016020527fedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b5676439062000278908262000a9e565b5060405180608001604052806043815260200162004b6960439139600560005260016020527fe2689cd4a84e23ad2f564004f1c9013e9589d260bde6380aba3ca7e09e4df40c90620002cb908262000a9e565b5060405180608001604052806043815260200162004ae360439139600160005260026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0906200031e908262000a9e565b506040518060800160405280604381526020016200499460439139600260008190526020527f679795a0195a1b76cdebb7c51d74e058aee92919b8c3389af86ef24535e8a28c9062000371908262000a9e565b50604051806080016040528060438152602001620049d760439139600360005260026020527f88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c390620003c4908262000a9e565b5060405180608001604052806043815260200162004a5d60439139600460005260026020527fee60d0579bcffd98e668647d59fec1ff86a7fb340ce572e844f234ae73a6918f9062000417908262000a9e565b506040518060800160405280604381526020016200495160439139600560005260026020527fb98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384906200046a908262000a9e565b506040805160a08101825261157c8152610bb860208201526103e8918101919091526101cc606082015260286080820152620004ab90600490600562000982565b5060bb6005556040516000903390620004c490620009d8565b6001600160a01b039091168152602001604051809103906000f080158015620004f1573d6000803e3d6000fd5b509050620005166200050e670de0b6b3a76400006103e862000b6a565b3383620006c0565b68a20d6e21d0e5255308805461ff0019169055620005aa73c7570dd89c04b2213d9044302cdb303fc2dc07866127106200055b670de0b6b3a76400006103e862000b6a565b6200056890603262000b6a565b62000574919062000b96565b68a20d6e21d0e525530b80546001600160a01b0319166001600160a01b03939093169290921790915568a20d6e21d0e525530e55565b603268a20d6e21d0e525530c81905568a20d6e21d0e525530d556200061560016064620005e2670de0b6b3a76400006103e862000b6a565b620005ee919062000b96565b68a20d6e21d0e5255308805460ff19169215159290921790915568a20d6e21d0e525530955565b5062000bb9565b60006200062983620008ce565b80549091506b01000000000000000000000090046002161515821515146200067557805460ff6b01000000000000000000000080830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051620006b3911515815260200190565b60405180910390a2505050565b68a20d6e21d0e525530f5468a20d6e21d0e525530890600160d01b900463ffffffff16156200070257604051633ab534b960e21b815260040160405180910390fd5b6001600160a01b0382166200072a576040516339a84a7b60e01b815260040160405180910390fd5b62000735826200094c565b805461ffff19166101001781556000600182018190556002820180546001600160a01b038087166001600160a01b03199283161790925560038401805482169055600484018390556005840183905560068401929092556007830180547fffff00000000ffffffff0000000000000000000000000000000000000000000016600160d01b179055600983018054918516919092161790558315620008c8576001600160a01b038316620007fb57604051633a954ecd60e21b815260040160405180910390fd5b6b0de0b6b39983494c589bffff841115620008295760405163e5cfe95760e01b815260040160405180910390fd5b600881018054600160201b600160801b0319166401000000006001600160601b0387160217905560006200085d84620008ce565b80546001600160a01b03908116600160a01b6001600160601b038916021782556040518781529192508516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3620008c68460016200061c565b505b50505050565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054909168a20d6e21d0e5255308916b0100000000000000000000009004600116900362000946576001833b1562000924576002175b825460ff9091166b0100000000000000000000000260ff60581b199091161782555b50919050565b630f4599e560005233602052602060006024601c6000855af1600160005114166200097f5763d125259c6000526004601cfd5b50565b828054828255906000526020600020908101928215620009c6579160200282015b82811115620009c6578251829061ffff16905591602001919060010190620009a3565b50620009d4929150620009e6565b5090565b610ca78062003c6783390190565b5b80821115620009d45760008155600101620009e7565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168062000a2857607f821691505b6020821081036200094657634e487b7160e01b600052602260045260246000fd5b601f82111562000a99576000816000526020600020601f850160051c8101602086101562000a745750805b601f850160051c820191505b8181101562000a955782815560010162000a80565b5050505b505050565b81516001600160401b0381111562000aba5762000aba620009fd565b62000ad28162000acb845462000a13565b8462000a49565b602080601f83116001811462000b0a576000841562000af15750858301515b600019600386901b1c1916600185901b17855562000a95565b600085815260208120601f198616915b8281101562000b3b5788860151825594840194600190910190840162000b1a565b508582101562000b5a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808202811582820484141762000b9057634e487b7160e01b600052601160045260246000fd5b92915050565b60008262000bb457634e487b7160e01b600052601260045260246000fd5b500490565b61309e8062000bc96000396000f3fe6080604052600436106102085760003560e01c80638da5cb5b11610118578063cdd055bc116100a0578063e01af92c1161006f578063e01af92c14610a16578063f275f64b14610a36578063f2fde38b14610a56578063f405008214610a76578063fd959e5914610a965761020f565b8063cdd055bc1461094f578063d188929f1461096f578063d731df40146109a8578063dd62ed3e146109c85761020f565b8063990ba0e9116100e7578063990ba0e9146108af5780639c83aecc146108cf578063a9059cbb146108ef578063a9f1e2a41461090f578063c87b56dd1461092f5761020f565b80638da5cb5b146108225780638e6d34ee1461084257806395d89b4114610862578063977a8bb61461088f5761020f565b80633ccfd60b1161019b5780636612e66f1161016a5780636612e66f1461078257806370a08231146107a257806372c8b488146107c257806383c1ee05146107e257806386135cc6146108025761020f565b80633ccfd60b146106f357806340c10f19146107085780634ef41efc146107285780635cb23e12146107625761020f565b8063274e430b116101d7578063274e430b146106725780632b96895814610692578063313ce567146106a75780633bc6fd02146106c35761020f565b806306fdde03146105a8578063095ea7b3146105ea57806318160ddd1461061a57806323b872dd146106525761020f565b3661020f57005b68a20d6e21d0e525530860003560e01c63e985e9c58190036102b55760098201546001600160a01b031633146102585760405163ce5a776b60e01b815260040160405180910390fd5b604436101561026657600080fd5b6004356001600160a01b038181166000908152600b85016020908152604080832060243594851684529091529020546102b29060ff166102a75760006102aa565b60015b60ff16610ab6565b50505b80636352211e0361031a5760098201546001600160a01b031633146102ed5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156102fb57600080fd5b60043561031861030a82610ac0565b6001600160a01b0316610ab6565b505b8063e5eb36c8036103875760098201546001600160a01b031633146103525760405163ce5a776b60e01b815260040160405180910390fd5b608436101561036057600080fd5b60043560243560443560643561037884848484610af7565b6103826001610ab6565b505050505b8063813500fc036103f15760098201546001600160a01b031633146103bf5760405163ce5a776b60e01b815260040160405180910390fd5b60643610156103cd57600080fd5b60043560243515156044356103e3838383610e86565b6103ed6001610ab6565b5050505b8063d10b6e0c036104525760098201546001600160a01b031633146104295760405163ce5a776b60e01b815260040160405180910390fd5b606436101561043757600080fd5b60043560243560443561044e61030a848484610ec8565b5050505b8063081812fc036104a95760098201546001600160a01b0316331461048a5760405163ce5a776b60e01b815260040160405180910390fd5b602436101561049857600080fd5b6004356104a761030a82610fa1565b505b8063f5b100ea036105315760098201546001600160a01b031633146104e15760405163ce5a776b60e01b815260040160405180910390fd5b60243610156104ef57600080fd5b60043561052f61052a826001600160a01b0316600090815268a20d6e21d0e5255318602052604090205463ffffffff600160801b9091041690565b610ab6565b505b8063e2c79281036105915760098201546001600160a01b031633146105695760405163ce5a776b60e01b815260040160405180910390fd5b600436101561057757600080fd5b61059161052a68a20d6e21d0e52553105463ffffffff1690565b8063b7a94eb8036105a6576105a66001610ab6565b005b3480156105b457600080fd5b5060408051808201909152600781526610cd14d20d0c0d60ca1b60208201525b6040516105e19190612a10565b60405180910390f35b3480156105f657600080fd5b5061060a610605366004612a58565b610fed565b60405190151581526020016105e1565b34801561062657600080fd5b5068a20d6e21d0e52553105464010000000090046001600160601b03165b6040519081526020016105e1565b34801561065e57600080fd5b5061060a61066d366004612a84565b611063565b34801561067e57600080fd5b5061060a61068d366004612ac5565b611106565b34801561069e57600080fd5b506105a6611155565b3480156106b357600080fd5b50604051601281526020016105e1565b3480156106cf57600080fd5b5061060a6106de366004612ac5565b60036020526000908152604090205460ff1681565b3480156106ff57600080fd5b506105a66111bb565b34801561071457600080fd5b506105a6610723366004612a58565b6111f0565b34801561073457600080fd5b5068a20d6e21d0e5255311546001600160a01b03165b6040516001600160a01b0390911681526020016105e1565b34801561076e57600080fd5b506105a661077d366004612ae2565b611257565b34801561078e57600080fd5b506105a661079d366004612b19565b61129c565b3480156107ae57600080fd5b506106446107bd366004612ac5565b6112d0565b3480156107ce57600080fd5b506105a66107dd366004612ac5565b611303565b3480156107ee57600080fd5b506105a66107fd366004612a58565b61135e565b34801561080e57600080fd5b506105a661081d366004612b19565b6113bc565b34801561082e57600080fd5b5060005461074a906001600160a01b031681565b34801561084e57600080fd5b506105d461085d366004612b5f565b611414565b34801561086e57600080fd5b5060408051808201909152600481526310cd0c0d60e21b60208201526105d4565b34801561089b57600080fd5b506105d46108aa366004612b5f565b6114ae565b3480156108bb57600080fd5b506105a66108ca366004612b7a565b6114c7565b3480156108db57600080fd5b506105a66108ea366004612bac565b611518565b3480156108fb57600080fd5b5061060a61090a366004612a58565b611563565b34801561091b57600080fd5b506105a661092a366004612bac565b611579565b34801561093b57600080fd5b506105d461094a366004612c6e565b6115bf565b34801561095b57600080fd5b506105a661096a366004612b19565b611616565b34801561097b57600080fd5b5061098f61098a366004612c6e565b61164a565b6040805160ff90931683526020830191909152016105e1565b3480156109b457600080fd5b5061060a6109c3366004612ac5565b611727565b3480156109d457600080fd5b506106446109e3366004612c87565b6001600160a01b03918216600090815268a20d6e21d0e52553156020908152604080832093909416825291909152205490565b348015610a2257600080fd5b506105a6610a31366004612cc0565b611773565b348015610a4257600080fd5b506105a6610a51366004612cc0565b6117c1565b348015610a6257600080fd5b506105a6610a71366004612ac5565b61180b565b348015610a8257600080fd5b506105a6610a91366004612c6e565b6118a7565b348015610aa257600080fd5b506105a6610ab1366004612b19565b6118d6565b8060005260206000f35b6000610acb826118e1565b610ae85760405163677510db60e11b815260040160405180910390fd5b610af1826118fe565b92915050565b68a20d6e21d0e52553086001600160a01b038416610b2857604051633a954ecd60e21b815260040160405180910390fd5b600081600a016000610b6484600f01610b418860011b90565b600381901c600090815260209290925260409091205460059190911b60e0161c90565b63ffffffff1681526020810191909152604001600020546001600160a01b03908116915086168114610ba85760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b031614610c2c576001600160a01b038087166000908152600b8401602090815260408083209387168352929052205460ff16610c2c576000848152600c830160205260409020546001600160a01b03848116911614610c2c57604051632ce44b5f60e11b815260040160405180910390fd5b6000610c3787611953565b90506000610c4487611953565b8254909150670de0b6b3a7640000908390601490610c73908490600160a01b90046001600160601b0316612cf1565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b928390048416019092160217825550610cd7600f8501600188901b610cd2848b6119bf565b611a6b565b6000868152600c85016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600e87018252808320855463ffffffff60801b198116600160801b9182900463ffffffff90811660001901908116909202178755631fffffff600382901c168552925282205460059190911b60e0161c6001600160a01b038a166000908152600e87016020526040902063ffffffff919091169150610d9b90610d8f600f880160018b811b01610b41565b63ffffffff1683611a6b565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610ded600f8701610ddb84600190811b0190565b610cd2600f8a0160018d811b01610b41565b6001600160a01b0389166000908152600e870160205260409020610e1290828a611a6b565b610e25600f870160018a811b0183611a6b565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610e7491815260200190565b60405180910390a35050505050505050565b6001600160a01b03908116600090815268a20d6e21d0e52553136020908152604080832095909316825293909352909120805460ff1916911515919091179055565b600068a20d6e21d0e52553088168a20d6e21d0e525531281610ef768a20d6e21d0e5255317600189901b610b41565b63ffffffff1681526020810191909152604001600020546001600160a01b03908116915084168114610f6b576001600160a01b038082166000908152600b8401602090815260408083209388168352929052205460ff16610f6b576040516367d9dca160e11b815260040160405180910390fd5b6000858152600c909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b6000610fac826118e1565b610fc95760405163677510db60e11b815260040160405180910390fd5b50600090815268a20d6e21d0e525531460205260409020546001600160a01b031690565b60008068a20d6e21d0e5255308336000818152600d8301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6001600160a01b038316600090815268a20d6e21d0e52553156020908152604080832033845290915281205468a20d6e21d0e52553089060001981146110ef57808411156110c4576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386166000908152600d830160209081526040808320338452909152902084820390555b6110fa868686611a9f565b50600195945050505050565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054600160581b9004600116820361114257823b5b9392505050565b54600160581b9004600216151592915050565b6000546001600160a01b0316331461117f576040516282b42960e81b815260040160405180910390fd5b600080546001600160a01b031916815560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3565b6000546001600160a01b031633146111e5576040516282b42960e81b815260040160405180910390fd5b6111ee33612219565b565b3360009081526003602052604090205460ff166112495760405162461bcd60e51b81526020600482015260136024820152724e6f74207374616b696e67206164647265737360681b604482015260640160405180910390fd5b6112538282612235565b5050565b6000546001600160a01b03163314611281576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530c9190915568a20d6e21d0e525530d55565b6000546001600160a01b031633146112c6576040516282b42960e81b815260040160405180910390fd5b6112538282612555565b6001600160a01b0316600090815268a20d6e21d0e52553186020526040902054600160a01b90046001600160601b031690565b6000546001600160a01b0316331461132d576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530f80546001600160a01b0319166001600160a01b03831617905561135b81600161259f565b50565b6000546001600160a01b03163314611388576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530b80546001600160a01b0319166001600160a01b03841617905568a20d6e21d0e525530e8190555050565b6000546001600160a01b031633146113e6576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0382166000908152600360205260409020805460ff1916821515179055611253828261259f565b6002602052600090815260409020805461142d90612d11565b80601f016020809104026020016040519081016040528092919081815260200182805461145990612d11565b80156114a65780601f1061147b576101008083540402835291602001916114a6565b820191906000526020600020905b81548152906001019060200180831161148957829003601f168201915b505050505081565b6001602052600090815260409020805461142d90612d11565b6000546001600160a01b031633146114f1576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e5255308805460ff191683151517905568a20d6e21d0e52553098190555050565b6000546001600160a01b03163314611542576040516282b42960e81b815260040160405180910390fd5b60ff8216600090815260016020526040902061155e8282612d95565b505050565b6000611570338484611a9f565b50600192915050565b6000546001600160a01b031633146115a3576040516282b42960e81b815260040160405180910390fd5b60ff8216600090815260026020526040902061155e8282612d95565b60606000806115cd8461164a565b60ff8216600090815260016020526040902091935091506115ed8261262f565b6040516020016115fe929190612e55565b60405160208183030381529060405292505050919050565b6000546001600160a01b03163314611640576040516282b42960e81b815260040160405180910390fd5b611253828261259f565b60008060008360405160200161166291815260200190565b60408051601f1981840301815291905280516020909101209050600061168a61271083612f02565b90506000805b60045460ff8216101561170a5760048160ff16815481106116b3576116b3612f16565b9060005260206000200154826116c99190612f2c565b9150818310156116f8576116de816001612f3f565b6005546116eb9086612f02565b9550955050505050915091565b8061170281612f58565b915050611690565b5060045460055461171b9085612f02565b94509450505050915091565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054600160581b9004600116820361176057823b61113b565b54600160581b9004600416151592915050565b6000546001600160a01b0316331461179d576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530f8054821515600160a81b0260ff60a81b1990911617905550565b6000546001600160a01b031633146117eb576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530880548215156101000261ff001990911617905550565b6000546001600160a01b03163314611835576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03811661185c576040516349e27cff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b031633146118d1576040516282b42960e81b815260040160405180910390fd5b600555565b611253828233610e86565b6000806118ed836118fe565b6001600160a01b0316141592915050565b600068a20d6e21d0e525530868a20d6e21d0e52553128261192c68a20d6e21d0e5255317600187901b610b41565b63ffffffff1681526020810191909152604001600020546001600160a01b03169392505050565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054909168a20d6e21d0e525530891600160581b900460011690036119b9576001833b1561199f576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b8154600160601b900463ffffffff1668a20d6e21d0e52553086000829003611a6457600781018054601690611a0090600160b01b900463ffffffff16612f77565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786556000908152600a83016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b038216611ac657604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553086000611adb85611953565b90506000611ae885611953565b9050611b236040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b9091041660408201819052851115611b7a57604051631e9acf1760e31b815260040160405180910390fd5b8354610100900460ff16158015611ba1575060028401546001600160a01b03888116911614155b8015611bbd575060028401546001600160a01b03878116911614155b15611bdb57604051632924508760e21b815260040160405180910390fd5b60408101805186900390528354600090610100900460ff168015611c03575060008560040154115b8015611c1e575060078501546001600160a01b038981169116145b8015611c4757506001600160a01b038716737a250d5630b4cf539739df2c5dacb4c659f2488d14155b8015611c5c57508254600160581b9004600416155b15611c80576064856004015487611c739190612f9a565b611c7d9190612fb1565b90505b8454610100900460ff168015611c9a575060008560050154115b8015611cb5575060078501546001600160a01b038881169116145b8015611cca57506001600160a01b0388163014155b15611cee576064856005015487611ce19190612f9a565b611ceb9190612fb1565b90505b8015611dda576000611cff30611953565b8054909150611d1f908390600160a01b90046001600160601b0316612f2c565b81546001600160601b0391909116600160a01b026001600160a01b03909116178155611d4b8288612fc5565b96506000611d58306112d0565b6007880154909150600160a01b900460ff16158015611d86575060078701546001600160a01b038a81169116145b8015611d9d57506007870154600160a81b900460ff165b8015611dac5750866006015481115b15611dd75786600601548810611dce57611dc987600601546126c2565b611dd7565b611dd7886126c2565b50505b604082015184546001600160601b03918216600160a01b9081026001600160a01b03928316178755855481810484168a0160608701819052909316029116178355845460ff1615611e665760018501548354670de0b6b3a764000090600160a01b90046001600160601b0316041115611e66576040516324691f6b60e01b815260040160405180910390fd5b611e938260800151670de0b6b3a7640000846040015181611e8957611e89612eec565b0480821191030290565b82528254600160581b9004600216600003611f0257866001600160a01b0316886001600160a01b031603611ecf57815160808301510360a08301525b611efc670de0b6b3a7640000836060015181611eed57611eed612eec565b048360a0015180821191030290565b60208301525b6000611f4c83602001518460000151016040805180820190915260608152600060208201526040805101828152806020018360051b81016040528183528083602001525050919050565b83519091501561204b576001600160a01b0389166000908152600e8701602052604090206080840151845160088901805463ffffffff19811663ffffffff918216849003821617909155885463ffffffff60801b1916600160801b928403918216929092029190911788555b60001991909101600381901c600090815260208490526040812054919291600584901b60e0161c63ffffffff169050611ff78a600f018260008061288f565b6000818152600c8b016020526040902080546001600160a01b031916905561203f858e8360018360200151818360081b8560601b171781526020810185602001525050505050565b50808203611fb8575050505b6020830151156121b2576001600160a01b0388166000908152600e870160209081526040822060a08601519186015190929082019061208a888d6119bf565b60088b01805460078d015460208b015163ffffffff808416909101811663ffffffff198416179093558b54868416600160801b0263ffffffff60801b19909116178c55929350670de0b6b3a76400006401000000009091046001600160601b03160491600160d01b9004165b6121078c600f01610b418360011b90565b63ffffffff16156121265760010181811115612121575060015b6120f6565b612131868683611a6b565b6121468c600f0182858880600101995061288f565b612170878f8360008360200151818360081b8560601b171781526020810185602001525050505050565b6001018181111561217f575060015b8385036120f65760078c01805463ffffffff909216600160d01b0263ffffffff60d01b1990921691909117905550505050505b805151156121d35760098601546121d39082906001600160a01b03166128d5565b50866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88604051610e7491815260200190565b60003860003847855af161135b5763b12d13eb6000526004601cfd5b6001600160a01b03821661225c57604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e5255308600061227184611953565b600883015490915064010000000090046001600160601b031683016b0de0b6b39983494c589bffff8411806122b157506b0de0b6b39983494c589bffff81115b156122cf5760405163e5cfe95760e01b815260040160405180910390fd5b6008830180546001600160601b03808416640100000000026fffffffffffffffffffffffff0000000019909216919091179091558254600160a01b80820483168701928316026001600160a01b0390911617808455600160581b900460021660000361250c576001600160a01b0386166000908152600e85016020526040812084549091600160801b90910463ffffffff1690670de0b6b3a76400008404905060006123b5838303848411026040805180820190915260608152600060208201526040805101828152806020018360051b81016040528183528083602001525050919050565b80515190915015612507576008880154670de0b6b3a76400006401000000009091046001600160601b03160460006123ed898d6119bf565b60078b015484515160088d01805463ffffffff818116909301831663ffffffff199091161790558b54878216600160801b0263ffffffff60801b19909116178c55919250600160d01b9004165b61244b8b600f01610b418360011b90565b63ffffffff161561246a5760010182811115612465575060015b61243a565b612475878783611a6b565b61248a8b600f01828489806001019a5061288f565b6124b4848e8360008360200151818360081b8560601b171781526020810185602001525050505050565b600101828111156124c3575060015b84860361243a5760078b01805463ffffffff60d01b1916600160d01b63ffffffff84160217905560098b01546125039085906001600160a01b03166128d5565b5050505b505050505b50506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b600061256083611953565b8054909150600160581b900460041615158215151461155e57805460ff600160581b80830482166004189091160260ff60581b19909116178155505050565b60006125aa83611953565b8054909150600160581b90046002161515821515146125e557805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051612622911515815260200190565b60405180910390a2505050565b6060600061263c83612914565b600101905060008167ffffffffffffffff81111561265c5761265c612b96565b6040519080825280601f01601f191660200182016040528015612686576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461269057509392505050565b68a20d6e21d0e525530f805460ff60a01b1916600160a01b17905568a20d6e21d0e52553086000816040805160028082526060820183529293506000929091602083019080368337019050509050308160008151811061272457612724612f16565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612796573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ba9190612fd8565b816001815181106127cd576127cd612f16565b6001600160a01b03928316602091820292909201810191909152306000908152600d850182526040808220737a250d5630b4cf539739df2c5dacb4c659f2488d80845293528082208890556003860154905163791ac94760e01b8152929363791ac94793612848938a93909288929116904290600401612ff5565b600060405180830381600087803b15801561286257600080fd5b505af1158015612876573d6000803e3d6000fd5b5050506007909301805460ff60a01b1916905550505050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84016000875af160018251141661290e57600081fd5b50505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129535772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061297f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061299d57662386f26fc10000830492506010015b6305f5e10083106129b5576305f5e100830492506008015b61271083106129c957612710830492506004015b606483106129db576064830492506002015b600a8310610af15760010192915050565b60005b83811015612a075781810151838201526020016129ef565b50506000910152565b6020815260008251806020840152612a2f8160408501602087016129ec565b601f01601f19169190910160400192915050565b6001600160a01b038116811461135b57600080fd5b60008060408385031215612a6b57600080fd5b8235612a7681612a43565b946020939093013593505050565b600080600060608486031215612a9957600080fd5b8335612aa481612a43565b92506020840135612ab481612a43565b929592945050506040919091013590565b600060208284031215612ad757600080fd5b813561113b81612a43565b60008060408385031215612af557600080fd5b50508035926020909101359150565b80358015158114612b1457600080fd5b919050565b60008060408385031215612b2c57600080fd5b8235612b3781612a43565b9150612b4560208401612b04565b90509250929050565b803560ff81168114612b1457600080fd5b600060208284031215612b7157600080fd5b61113b82612b4e565b60008060408385031215612b8d57600080fd5b612a7683612b04565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612bbf57600080fd5b612bc883612b4e565b9150602083013567ffffffffffffffff80821115612be557600080fd5b818501915085601f830112612bf957600080fd5b813581811115612c0b57612c0b612b96565b604051601f8201601f19908116603f01168101908382118183101715612c3357612c33612b96565b81604052828152886020848701011115612c4c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215612c8057600080fd5b5035919050565b60008060408385031215612c9a57600080fd5b8235612ca581612a43565b91506020830135612cb581612a43565b809150509250929050565b600060208284031215612cd257600080fd5b61113b82612b04565b634e487b7160e01b600052601160045260246000fd5b6001600160601b03828116828216039080821115611a6457611a64612cdb565b600181811c90821680612d2557607f821691505b6020821081036119b957634e487b7160e01b600052602260045260246000fd5b601f82111561155e576000816000526020600020601f850160051c81016020861015612d6e5750805b601f850160051c820191505b81811015612d8d57828155600101612d7a565b505050505050565b815167ffffffffffffffff811115612daf57612daf612b96565b612dc381612dbd8454612d11565b84612d45565b602080601f831160018114612df85760008415612de05750858301515b600019600386901b1c1916600185901b178555612d8d565b600085815260208120601f198616915b82811015612e2757888601518255948401946001909101908401612e08565b5085821015612e455787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000808454612e6381612d11565b60018281168015612e7b5760018114612e9057612ebf565b60ff1984168752821515830287019450612ebf565b8860005260208060002060005b85811015612eb65781548a820152908401908201612e9d565b50505082870194505b505050508351612ed38183602088016129ec565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612f1157612f11612eec565b500690565b634e487b7160e01b600052603260045260246000fd5b80820180821115610af157610af1612cdb565b60ff8181168382160190811115610af157610af1612cdb565b600060ff821660ff8103612f6e57612f6e612cdb565b60010192915050565b600063ffffffff808316818103612f9057612f90612cdb565b6001019392505050565b8082028115828204841417610af157610af1612cdb565b600082612fc057612fc0612eec565b500490565b81810381811115610af157610af1612cdb565b600060208284031215612fea57600080fd5b815161113b81612a43565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b818110156130475784516001600160a01b031683529383019391830191600101613022565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122089a5e2a68e53fe0f98c7667a4917c6382aea7486c131698b030bc2c800a12af864736f6c63430008180033608060405234801561001057600080fd5b50604051610ca7380380610ca783398101604081905261002f9161005c565b683602298b8c10b0123180546001600160a01b0319166001600160a01b039290921691909117905561008c565b60006020828403121561006e57600080fd5b81516001600160a01b038116811461008557600080fd5b9392505050565b610c0c8061009b6000396000f3fe6080604052600436106100ec5760003560e01c80636352211e1161008a578063a22cb46511610059578063a22cb465146103e8578063b88d4fde14610408578063c87b56dd14610428578063e985e9c514610448576100f3565b80636352211e1461037e57806370a082311461039e57806395d89b41146103be57806397e5311c146103d3576100f3565b8063095ea7b3116100c6578063095ea7b31461030857806318160ddd1461032857806323b872dd1461034b57806342842e0e1461036b576100f3565b806301ffc9a71461025c57806306fdde03146102ae578063081812fc146102d0576100f3565b366100f357005b683602298b8c10b0123060003560e01c63263c69d68190036101bf5781546001600160a01b0316331461013957604051631b1e598960e11b815260040160405180910390fd5b602036103d60003e6004356024018036103d60003e602081033560051b81018036103d60003e5b8082146101b25781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a4505050816020019150610160565b5050600160005260206000f35b80630f4599e50361025a5760018201546001600160a01b0316156102155760018201546001600160a01b03166004356001600160a01b031614610215576040516362cf623d60e11b815260040160405180910390fd5b81546001600160a01b03161561023e57604051635fb2b52360e11b815260040160405180910390fd5b81546001600160a01b0319163317825560016000908152602090f35b005b34801561026857600080fd5b50610299610277366004610996565b6301ffc9a760e09190911c9081146380ac58cd821417635b5e139f9091141790565b60405190151581526020015b60405180910390f35b3480156102ba57600080fd5b506102c3610468565b6040516102a591906109c7565b3480156102dc57600080fd5b506102f06102eb366004610a16565b6104c2565b6040516001600160a01b0390911681526020016102a5565b34801561031457600080fd5b5061025a610323366004610a4b565b610509565b34801561033457600080fd5b5061033d61058f565b6040519081526020016102a5565b34801561035757600080fd5b5061025a610366366004610a75565b6105cd565b61025a610379366004610a75565b61065c565b34801561038a57600080fd5b506102f0610399366004610a16565b61068e565b3480156103aa57600080fd5b5061033d6103b9366004610ab1565b6106c8565b3480156103ca57600080fd5b506102c3610712565b3480156103df57600080fd5b506102f0610744565b3480156103f457600080fd5b5061025a610403366004610acc565b610779565b34801561041457600080fd5b5061025a610423366004610b08565b6107fc565b34801561043457600080fd5b506102c3610443366004610a16565b610857565b34801561045457600080fd5b50610299610463366004610ba3565b6108b7565b60606000610474610744565b905060405191506306fdde036000526000806004601c845afa61049a573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016040525090565b6000806104cd610744565b905063081812fc60005282602052602060006024601c845afa601f3d11166104fc573d60006040513e3d604051fd5b5050600c5160601c919050565b6000610513610744565b90508260601b60601c925060405163d10b6e0c600052836020528260405233606052602060006064601c34865af1601f3d1116610553573d6000823e3d81fd5b806040525060006060528183600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4505050565b60008061059a610744565b905063e2c79281600052602060006004601c845afa601f3d11166105c5573d60006040513e3d604051fd5b505060005190565b60006105d7610744565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af160018251141661062d573d6000823e3d81fd5b508183857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a450505050565b6106678383836105cd565b813b15610689576106898383836040518060200160405280600081525061090a565b505050565b600080610699610744565b9050636352211e60005282602052602060006024601c845afa601f3d11166104fc573d60006040513e3d604051fd5b6000806106d3610744565b90508260601b60601c60205263f5b100ea600052602060006024601c845afa601f3d1116610708573d60006040513e3d604051fd5b5050600051919050565b6060600061071e610744565b905060405191506395d89b416000526000806004601c845afa61049a573d6000833e3d82fd5b683602298b8c10b01230546001600160a01b03168061077657604051632d9523d760e11b815260040160405180910390fd5b90565b6000610783610744565b90508260601b60601c925060405163813500fc6000528360205282151560405233606052602060006064601c34865af1600160005114166107c7573d6000823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a36040525050600060605250565b6108078585856105cd565b833b156108505761085085858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090a92505050565b5050505050565b60606000610863610744565b905060405191508260205263c87b56dd6000526000806024601c845afa61088d573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e8151602083010160405250919050565b6000806108c2610744565b9050604051836040528460601b602c5263e985e9c560601b600c52602060006044601c855afa601f3d11166108fa573d6000823e3d81fd5b6040525050600051151592915050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015610951578060c08401826020870160045afa505b60208360a48301601c860160008a5af1610974573d15610974573d6000843e3d83fd5b508060e01b82511461098e5763d1a57ed66000526004601cfd5b505050505050565b6000602082840312156109a857600080fd5b81356001600160e01b0319811681146109c057600080fd5b9392505050565b60006020808352835180602085015260005b818110156109f5578581018301518582016040015282016109d9565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215610a2857600080fd5b5035919050565b80356001600160a01b0381168114610a4657600080fd5b919050565b60008060408385031215610a5e57600080fd5b610a6783610a2f565b946020939093013593505050565b600080600060608486031215610a8a57600080fd5b610a9384610a2f565b9250610aa160208501610a2f565b9150604084013590509250925092565b600060208284031215610ac357600080fd5b6109c082610a2f565b60008060408385031215610adf57600080fd5b610ae883610a2f565b915060208301358015158114610afd57600080fd5b809150509250929050565b600080600080600060808688031215610b2057600080fd5b610b2986610a2f565b9450610b3760208701610a2f565b935060408601359250606086013567ffffffffffffffff80821115610b5b57600080fd5b818801915088601f830112610b6f57600080fd5b813581811115610b7e57600080fd5b896020828501011115610b9057600080fd5b9699959850939650602001949392505050565b60008060408385031215610bb657600080fd5b610bbf83610a2f565b9150610bcd60208401610a2f565b9050925092905056fea264697066735822122028cd281d91a9c3876c78dae8513fd356a4605322ae778acd75a88bc4c3931e2a64736f6c63430008180033697066733a2f2f62616679626569656e6a626779367968783476356c6a686c6a753466617975626770656f7736366272726633776576796d70666b66337a7933656d2f697066733a2f2f6261667962656964736b77636579696634696561736269627a6770676d726b376a33766867686f363532636a7066676675626570736273686271652f697066733a2f2f62616679626569617033627a6362336c3234346266346c6c66616d68796b6879636e736e796d7877326f77757574326a6f343676676d6e636d64792f697066733a2f2f62616679626569633279347134696e6678637971726273713237647a62716d6261786176787869617374786b71796872667a7268636537683764712f697066733a2f2f626166796265696233776862366a6a357234676d33347932787064657775336a3675647a643478756b6469337632367061796f67716e6e6f7571752f697066733a2f2f626166796265696776746a7a6837346773327967706365757776326d333371376f3464356b616b7674633362796c706b7874653563357271646b752f697066733a2f2f62616679626569667765356c6c79757a3769626e776f7763676e6d6c7077686b6d74746867346b73767962356336746966347a6c347270736869712f697066733a2f2f626166796265696374376d7261667263723561363332326a736978787771643362366f797a73676b686f7275796e636d326b716f6a326c6d72726d2f697066733a2f2f6261667962656966693764356361346962347570646b64376c656932647a746f66646d646d6674337168687134756f6c61667171686270616f79752f697066733a2f2f6261667962656962707837776e677a67743367746c76796a696a706b3362356565676b3378336a71356f36796b6e346176697477366162736c6c692f
Deployed Bytecode
0x6080604052600436106102085760003560e01c80638da5cb5b11610118578063cdd055bc116100a0578063e01af92c1161006f578063e01af92c14610a16578063f275f64b14610a36578063f2fde38b14610a56578063f405008214610a76578063fd959e5914610a965761020f565b8063cdd055bc1461094f578063d188929f1461096f578063d731df40146109a8578063dd62ed3e146109c85761020f565b8063990ba0e9116100e7578063990ba0e9146108af5780639c83aecc146108cf578063a9059cbb146108ef578063a9f1e2a41461090f578063c87b56dd1461092f5761020f565b80638da5cb5b146108225780638e6d34ee1461084257806395d89b4114610862578063977a8bb61461088f5761020f565b80633ccfd60b1161019b5780636612e66f1161016a5780636612e66f1461078257806370a08231146107a257806372c8b488146107c257806383c1ee05146107e257806386135cc6146108025761020f565b80633ccfd60b146106f357806340c10f19146107085780634ef41efc146107285780635cb23e12146107625761020f565b8063274e430b116101d7578063274e430b146106725780632b96895814610692578063313ce567146106a75780633bc6fd02146106c35761020f565b806306fdde03146105a8578063095ea7b3146105ea57806318160ddd1461061a57806323b872dd146106525761020f565b3661020f57005b68a20d6e21d0e525530860003560e01c63e985e9c58190036102b55760098201546001600160a01b031633146102585760405163ce5a776b60e01b815260040160405180910390fd5b604436101561026657600080fd5b6004356001600160a01b038181166000908152600b85016020908152604080832060243594851684529091529020546102b29060ff166102a75760006102aa565b60015b60ff16610ab6565b50505b80636352211e0361031a5760098201546001600160a01b031633146102ed5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156102fb57600080fd5b60043561031861030a82610ac0565b6001600160a01b0316610ab6565b505b8063e5eb36c8036103875760098201546001600160a01b031633146103525760405163ce5a776b60e01b815260040160405180910390fd5b608436101561036057600080fd5b60043560243560443560643561037884848484610af7565b6103826001610ab6565b505050505b8063813500fc036103f15760098201546001600160a01b031633146103bf5760405163ce5a776b60e01b815260040160405180910390fd5b60643610156103cd57600080fd5b60043560243515156044356103e3838383610e86565b6103ed6001610ab6565b5050505b8063d10b6e0c036104525760098201546001600160a01b031633146104295760405163ce5a776b60e01b815260040160405180910390fd5b606436101561043757600080fd5b60043560243560443561044e61030a848484610ec8565b5050505b8063081812fc036104a95760098201546001600160a01b0316331461048a5760405163ce5a776b60e01b815260040160405180910390fd5b602436101561049857600080fd5b6004356104a761030a82610fa1565b505b8063f5b100ea036105315760098201546001600160a01b031633146104e15760405163ce5a776b60e01b815260040160405180910390fd5b60243610156104ef57600080fd5b60043561052f61052a826001600160a01b0316600090815268a20d6e21d0e5255318602052604090205463ffffffff600160801b9091041690565b610ab6565b505b8063e2c79281036105915760098201546001600160a01b031633146105695760405163ce5a776b60e01b815260040160405180910390fd5b600436101561057757600080fd5b61059161052a68a20d6e21d0e52553105463ffffffff1690565b8063b7a94eb8036105a6576105a66001610ab6565b005b3480156105b457600080fd5b5060408051808201909152600781526610cd14d20d0c0d60ca1b60208201525b6040516105e19190612a10565b60405180910390f35b3480156105f657600080fd5b5061060a610605366004612a58565b610fed565b60405190151581526020016105e1565b34801561062657600080fd5b5068a20d6e21d0e52553105464010000000090046001600160601b03165b6040519081526020016105e1565b34801561065e57600080fd5b5061060a61066d366004612a84565b611063565b34801561067e57600080fd5b5061060a61068d366004612ac5565b611106565b34801561069e57600080fd5b506105a6611155565b3480156106b357600080fd5b50604051601281526020016105e1565b3480156106cf57600080fd5b5061060a6106de366004612ac5565b60036020526000908152604090205460ff1681565b3480156106ff57600080fd5b506105a66111bb565b34801561071457600080fd5b506105a6610723366004612a58565b6111f0565b34801561073457600080fd5b5068a20d6e21d0e5255311546001600160a01b03165b6040516001600160a01b0390911681526020016105e1565b34801561076e57600080fd5b506105a661077d366004612ae2565b611257565b34801561078e57600080fd5b506105a661079d366004612b19565b61129c565b3480156107ae57600080fd5b506106446107bd366004612ac5565b6112d0565b3480156107ce57600080fd5b506105a66107dd366004612ac5565b611303565b3480156107ee57600080fd5b506105a66107fd366004612a58565b61135e565b34801561080e57600080fd5b506105a661081d366004612b19565b6113bc565b34801561082e57600080fd5b5060005461074a906001600160a01b031681565b34801561084e57600080fd5b506105d461085d366004612b5f565b611414565b34801561086e57600080fd5b5060408051808201909152600481526310cd0c0d60e21b60208201526105d4565b34801561089b57600080fd5b506105d46108aa366004612b5f565b6114ae565b3480156108bb57600080fd5b506105a66108ca366004612b7a565b6114c7565b3480156108db57600080fd5b506105a66108ea366004612bac565b611518565b3480156108fb57600080fd5b5061060a61090a366004612a58565b611563565b34801561091b57600080fd5b506105a661092a366004612bac565b611579565b34801561093b57600080fd5b506105d461094a366004612c6e565b6115bf565b34801561095b57600080fd5b506105a661096a366004612b19565b611616565b34801561097b57600080fd5b5061098f61098a366004612c6e565b61164a565b6040805160ff90931683526020830191909152016105e1565b3480156109b457600080fd5b5061060a6109c3366004612ac5565b611727565b3480156109d457600080fd5b506106446109e3366004612c87565b6001600160a01b03918216600090815268a20d6e21d0e52553156020908152604080832093909416825291909152205490565b348015610a2257600080fd5b506105a6610a31366004612cc0565b611773565b348015610a4257600080fd5b506105a6610a51366004612cc0565b6117c1565b348015610a6257600080fd5b506105a6610a71366004612ac5565b61180b565b348015610a8257600080fd5b506105a6610a91366004612c6e565b6118a7565b348015610aa257600080fd5b506105a6610ab1366004612b19565b6118d6565b8060005260206000f35b6000610acb826118e1565b610ae85760405163677510db60e11b815260040160405180910390fd5b610af1826118fe565b92915050565b68a20d6e21d0e52553086001600160a01b038416610b2857604051633a954ecd60e21b815260040160405180910390fd5b600081600a016000610b6484600f01610b418860011b90565b600381901c600090815260209290925260409091205460059190911b60e0161c90565b63ffffffff1681526020810191909152604001600020546001600160a01b03908116915086168114610ba85760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b031614610c2c576001600160a01b038087166000908152600b8401602090815260408083209387168352929052205460ff16610c2c576000848152600c830160205260409020546001600160a01b03848116911614610c2c57604051632ce44b5f60e11b815260040160405180910390fd5b6000610c3787611953565b90506000610c4487611953565b8254909150670de0b6b3a7640000908390601490610c73908490600160a01b90046001600160601b0316612cf1565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b928390048416019092160217825550610cd7600f8501600188901b610cd2848b6119bf565b611a6b565b6000868152600c85016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600e87018252808320855463ffffffff60801b198116600160801b9182900463ffffffff90811660001901908116909202178755631fffffff600382901c168552925282205460059190911b60e0161c6001600160a01b038a166000908152600e87016020526040902063ffffffff919091169150610d9b90610d8f600f880160018b811b01610b41565b63ffffffff1683611a6b565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610ded600f8701610ddb84600190811b0190565b610cd2600f8a0160018d811b01610b41565b6001600160a01b0389166000908152600e870160205260409020610e1290828a611a6b565b610e25600f870160018a811b0183611a6b565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610e7491815260200190565b60405180910390a35050505050505050565b6001600160a01b03908116600090815268a20d6e21d0e52553136020908152604080832095909316825293909352909120805460ff1916911515919091179055565b600068a20d6e21d0e52553088168a20d6e21d0e525531281610ef768a20d6e21d0e5255317600189901b610b41565b63ffffffff1681526020810191909152604001600020546001600160a01b03908116915084168114610f6b576001600160a01b038082166000908152600b8401602090815260408083209388168352929052205460ff16610f6b576040516367d9dca160e11b815260040160405180910390fd5b6000858152600c909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b6000610fac826118e1565b610fc95760405163677510db60e11b815260040160405180910390fd5b50600090815268a20d6e21d0e525531460205260409020546001600160a01b031690565b60008068a20d6e21d0e5255308336000818152600d8301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6001600160a01b038316600090815268a20d6e21d0e52553156020908152604080832033845290915281205468a20d6e21d0e52553089060001981146110ef57808411156110c4576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386166000908152600d830160209081526040808320338452909152902084820390555b6110fa868686611a9f565b50600195945050505050565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054600160581b9004600116820361114257823b5b9392505050565b54600160581b9004600216151592915050565b6000546001600160a01b0316331461117f576040516282b42960e81b815260040160405180910390fd5b600080546001600160a01b031916815560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3565b6000546001600160a01b031633146111e5576040516282b42960e81b815260040160405180910390fd5b6111ee33612219565b565b3360009081526003602052604090205460ff166112495760405162461bcd60e51b81526020600482015260136024820152724e6f74207374616b696e67206164647265737360681b604482015260640160405180910390fd5b6112538282612235565b5050565b6000546001600160a01b03163314611281576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530c9190915568a20d6e21d0e525530d55565b6000546001600160a01b031633146112c6576040516282b42960e81b815260040160405180910390fd5b6112538282612555565b6001600160a01b0316600090815268a20d6e21d0e52553186020526040902054600160a01b90046001600160601b031690565b6000546001600160a01b0316331461132d576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530f80546001600160a01b0319166001600160a01b03831617905561135b81600161259f565b50565b6000546001600160a01b03163314611388576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530b80546001600160a01b0319166001600160a01b03841617905568a20d6e21d0e525530e8190555050565b6000546001600160a01b031633146113e6576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0382166000908152600360205260409020805460ff1916821515179055611253828261259f565b6002602052600090815260409020805461142d90612d11565b80601f016020809104026020016040519081016040528092919081815260200182805461145990612d11565b80156114a65780601f1061147b576101008083540402835291602001916114a6565b820191906000526020600020905b81548152906001019060200180831161148957829003601f168201915b505050505081565b6001602052600090815260409020805461142d90612d11565b6000546001600160a01b031633146114f1576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e5255308805460ff191683151517905568a20d6e21d0e52553098190555050565b6000546001600160a01b03163314611542576040516282b42960e81b815260040160405180910390fd5b60ff8216600090815260016020526040902061155e8282612d95565b505050565b6000611570338484611a9f565b50600192915050565b6000546001600160a01b031633146115a3576040516282b42960e81b815260040160405180910390fd5b60ff8216600090815260026020526040902061155e8282612d95565b60606000806115cd8461164a565b60ff8216600090815260016020526040902091935091506115ed8261262f565b6040516020016115fe929190612e55565b60405160208183030381529060405292505050919050565b6000546001600160a01b03163314611640576040516282b42960e81b815260040160405180910390fd5b611253828261259f565b60008060008360405160200161166291815260200190565b60408051601f1981840301815291905280516020909101209050600061168a61271083612f02565b90506000805b60045460ff8216101561170a5760048160ff16815481106116b3576116b3612f16565b9060005260206000200154826116c99190612f2c565b9150818310156116f8576116de816001612f3f565b6005546116eb9086612f02565b9550955050505050915091565b8061170281612f58565b915050611690565b5060045460055461171b9085612f02565b94509450505050915091565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054600160581b9004600116820361176057823b61113b565b54600160581b9004600416151592915050565b6000546001600160a01b0316331461179d576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530f8054821515600160a81b0260ff60a81b1990911617905550565b6000546001600160a01b031633146117eb576040516282b42960e81b815260040160405180910390fd5b68a20d6e21d0e525530880548215156101000261ff001990911617905550565b6000546001600160a01b03163314611835576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03811661185c576040516349e27cff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b031633146118d1576040516282b42960e81b815260040160405180910390fd5b600555565b611253828233610e86565b6000806118ed836118fe565b6001600160a01b0316141592915050565b600068a20d6e21d0e525530868a20d6e21d0e52553128261192c68a20d6e21d0e5255317600187901b610b41565b63ffffffff1681526020810191909152604001600020546001600160a01b03169392505050565b6001600160a01b038116600090815268a20d6e21d0e5255318602052604081208054909168a20d6e21d0e525530891600160581b900460011690036119b9576001833b1561199f576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b8154600160601b900463ffffffff1668a20d6e21d0e52553086000829003611a6457600781018054601690611a0090600160b01b900463ffffffff16612f77565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786556000908152600a83016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b038216611ac657604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553086000611adb85611953565b90506000611ae885611953565b9050611b236040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b9091041660408201819052851115611b7a57604051631e9acf1760e31b815260040160405180910390fd5b8354610100900460ff16158015611ba1575060028401546001600160a01b03888116911614155b8015611bbd575060028401546001600160a01b03878116911614155b15611bdb57604051632924508760e21b815260040160405180910390fd5b60408101805186900390528354600090610100900460ff168015611c03575060008560040154115b8015611c1e575060078501546001600160a01b038981169116145b8015611c4757506001600160a01b038716737a250d5630b4cf539739df2c5dacb4c659f2488d14155b8015611c5c57508254600160581b9004600416155b15611c80576064856004015487611c739190612f9a565b611c7d9190612fb1565b90505b8454610100900460ff168015611c9a575060008560050154115b8015611cb5575060078501546001600160a01b038881169116145b8015611cca57506001600160a01b0388163014155b15611cee576064856005015487611ce19190612f9a565b611ceb9190612fb1565b90505b8015611dda576000611cff30611953565b8054909150611d1f908390600160a01b90046001600160601b0316612f2c565b81546001600160601b0391909116600160a01b026001600160a01b03909116178155611d4b8288612fc5565b96506000611d58306112d0565b6007880154909150600160a01b900460ff16158015611d86575060078701546001600160a01b038a81169116145b8015611d9d57506007870154600160a81b900460ff165b8015611dac5750866006015481115b15611dd75786600601548810611dce57611dc987600601546126c2565b611dd7565b611dd7886126c2565b50505b604082015184546001600160601b03918216600160a01b9081026001600160a01b03928316178755855481810484168a0160608701819052909316029116178355845460ff1615611e665760018501548354670de0b6b3a764000090600160a01b90046001600160601b0316041115611e66576040516324691f6b60e01b815260040160405180910390fd5b611e938260800151670de0b6b3a7640000846040015181611e8957611e89612eec565b0480821191030290565b82528254600160581b9004600216600003611f0257866001600160a01b0316886001600160a01b031603611ecf57815160808301510360a08301525b611efc670de0b6b3a7640000836060015181611eed57611eed612eec565b048360a0015180821191030290565b60208301525b6000611f4c83602001518460000151016040805180820190915260608152600060208201526040805101828152806020018360051b81016040528183528083602001525050919050565b83519091501561204b576001600160a01b0389166000908152600e8701602052604090206080840151845160088901805463ffffffff19811663ffffffff918216849003821617909155885463ffffffff60801b1916600160801b928403918216929092029190911788555b60001991909101600381901c600090815260208490526040812054919291600584901b60e0161c63ffffffff169050611ff78a600f018260008061288f565b6000818152600c8b016020526040902080546001600160a01b031916905561203f858e8360018360200151818360081b8560601b171781526020810185602001525050505050565b50808203611fb8575050505b6020830151156121b2576001600160a01b0388166000908152600e870160209081526040822060a08601519186015190929082019061208a888d6119bf565b60088b01805460078d015460208b015163ffffffff808416909101811663ffffffff198416179093558b54868416600160801b0263ffffffff60801b19909116178c55929350670de0b6b3a76400006401000000009091046001600160601b03160491600160d01b9004165b6121078c600f01610b418360011b90565b63ffffffff16156121265760010181811115612121575060015b6120f6565b612131868683611a6b565b6121468c600f0182858880600101995061288f565b612170878f8360008360200151818360081b8560601b171781526020810185602001525050505050565b6001018181111561217f575060015b8385036120f65760078c01805463ffffffff909216600160d01b0263ffffffff60d01b1990921691909117905550505050505b805151156121d35760098601546121d39082906001600160a01b03166128d5565b50866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88604051610e7491815260200190565b60003860003847855af161135b5763b12d13eb6000526004601cfd5b6001600160a01b03821661225c57604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e5255308600061227184611953565b600883015490915064010000000090046001600160601b031683016b0de0b6b39983494c589bffff8411806122b157506b0de0b6b39983494c589bffff81115b156122cf5760405163e5cfe95760e01b815260040160405180910390fd5b6008830180546001600160601b03808416640100000000026fffffffffffffffffffffffff0000000019909216919091179091558254600160a01b80820483168701928316026001600160a01b0390911617808455600160581b900460021660000361250c576001600160a01b0386166000908152600e85016020526040812084549091600160801b90910463ffffffff1690670de0b6b3a76400008404905060006123b5838303848411026040805180820190915260608152600060208201526040805101828152806020018360051b81016040528183528083602001525050919050565b80515190915015612507576008880154670de0b6b3a76400006401000000009091046001600160601b03160460006123ed898d6119bf565b60078b015484515160088d01805463ffffffff818116909301831663ffffffff199091161790558b54878216600160801b0263ffffffff60801b19909116178c55919250600160d01b9004165b61244b8b600f01610b418360011b90565b63ffffffff161561246a5760010182811115612465575060015b61243a565b612475878783611a6b565b61248a8b600f01828489806001019a5061288f565b6124b4848e8360008360200151818360081b8560601b171781526020810185602001525050505050565b600101828111156124c3575060015b84860361243a5760078b01805463ffffffff60d01b1916600160d01b63ffffffff84160217905560098b01546125039085906001600160a01b03166128d5565b5050505b505050505b50506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b600061256083611953565b8054909150600160581b900460041615158215151461155e57805460ff600160581b80830482166004189091160260ff60581b19909116178155505050565b60006125aa83611953565b8054909150600160581b90046002161515821515146125e557805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051612622911515815260200190565b60405180910390a2505050565b6060600061263c83612914565b600101905060008167ffffffffffffffff81111561265c5761265c612b96565b6040519080825280601f01601f191660200182016040528015612686576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461269057509392505050565b68a20d6e21d0e525530f805460ff60a01b1916600160a01b17905568a20d6e21d0e52553086000816040805160028082526060820183529293506000929091602083019080368337019050509050308160008151811061272457612724612f16565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612796573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ba9190612fd8565b816001815181106127cd576127cd612f16565b6001600160a01b03928316602091820292909201810191909152306000908152600d850182526040808220737a250d5630b4cf539739df2c5dacb4c659f2488d80845293528082208890556003860154905163791ac94760e01b8152929363791ac94793612848938a93909288929116904290600401612ff5565b600060405180830381600087803b15801561286257600080fd5b505af1158015612876573d6000803e3d6000fd5b5050506007909301805460ff60a01b1916905550505050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84016000875af160018251141661290e57600081fd5b50505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129535772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061297f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061299d57662386f26fc10000830492506010015b6305f5e10083106129b5576305f5e100830492506008015b61271083106129c957612710830492506004015b606483106129db576064830492506002015b600a8310610af15760010192915050565b60005b83811015612a075781810151838201526020016129ef565b50506000910152565b6020815260008251806020840152612a2f8160408501602087016129ec565b601f01601f19169190910160400192915050565b6001600160a01b038116811461135b57600080fd5b60008060408385031215612a6b57600080fd5b8235612a7681612a43565b946020939093013593505050565b600080600060608486031215612a9957600080fd5b8335612aa481612a43565b92506020840135612ab481612a43565b929592945050506040919091013590565b600060208284031215612ad757600080fd5b813561113b81612a43565b60008060408385031215612af557600080fd5b50508035926020909101359150565b80358015158114612b1457600080fd5b919050565b60008060408385031215612b2c57600080fd5b8235612b3781612a43565b9150612b4560208401612b04565b90509250929050565b803560ff81168114612b1457600080fd5b600060208284031215612b7157600080fd5b61113b82612b4e565b60008060408385031215612b8d57600080fd5b612a7683612b04565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612bbf57600080fd5b612bc883612b4e565b9150602083013567ffffffffffffffff80821115612be557600080fd5b818501915085601f830112612bf957600080fd5b813581811115612c0b57612c0b612b96565b604051601f8201601f19908116603f01168101908382118183101715612c3357612c33612b96565b81604052828152886020848701011115612c4c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215612c8057600080fd5b5035919050565b60008060408385031215612c9a57600080fd5b8235612ca581612a43565b91506020830135612cb581612a43565b809150509250929050565b600060208284031215612cd257600080fd5b61113b82612b04565b634e487b7160e01b600052601160045260246000fd5b6001600160601b03828116828216039080821115611a6457611a64612cdb565b600181811c90821680612d2557607f821691505b6020821081036119b957634e487b7160e01b600052602260045260246000fd5b601f82111561155e576000816000526020600020601f850160051c81016020861015612d6e5750805b601f850160051c820191505b81811015612d8d57828155600101612d7a565b505050505050565b815167ffffffffffffffff811115612daf57612daf612b96565b612dc381612dbd8454612d11565b84612d45565b602080601f831160018114612df85760008415612de05750858301515b600019600386901b1c1916600185901b178555612d8d565b600085815260208120601f198616915b82811015612e2757888601518255948401946001909101908401612e08565b5085821015612e455787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000808454612e6381612d11565b60018281168015612e7b5760018114612e9057612ebf565b60ff1984168752821515830287019450612ebf565b8860005260208060002060005b85811015612eb65781548a820152908401908201612e9d565b50505082870194505b505050508351612ed38183602088016129ec565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612f1157612f11612eec565b500690565b634e487b7160e01b600052603260045260246000fd5b80820180821115610af157610af1612cdb565b60ff8181168382160190811115610af157610af1612cdb565b600060ff821660ff8103612f6e57612f6e612cdb565b60010192915050565b600063ffffffff808316818103612f9057612f90612cdb565b6001019392505050565b8082028115828204841417610af157610af1612cdb565b600082612fc057612fc0612eec565b500490565b81810381811115610af157610af1612cdb565b600060208284031215612fea57600080fd5b815161113b81612a43565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b818110156130475784516001600160a01b031683529383019391830191600101613022565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122089a5e2a68e53fe0f98c7667a4917c6382aea7486c131698b030bc2c800a12af864736f6c63430008180033
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.