ERC-20
Overview
Max Total Supply
10,000 PT404
Holders
152
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Portal404
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {ERC404} from "./ERC404/ERC404.sol"; import {ERC5169} from "stl-contracts/ERC/ERC5169.sol"; import {ERC404UniswapV3Exempt} from "./ERC404/extensions/ERC404UniswapV3Exempt.sol"; contract Portal404 is Ownable, ERC404, ERC5169, ERC404UniswapV3Exempt { using Strings for uint256; uint8 constant _decimals = 18; uint256 _maxTotalSupplyERC721 = 10000; event BaseUriUpdate(string uri); event WebsiteUrlUpdate(string uri); event ContractUriUpdate(string uri); event Set721TransferExempt(address txExempt); string private constant __NAME = "PORTAL404"; string private constant __SYM = "PT404"; string private _websiteUri; string public _baseUri; string private _contractUri; address private constant _uniswapV3Router = 0xE592427A0AEce92De3Edee1F18E0157C05861564; constructor( address initialOwner_, address initialMintRecipient_ ) ERC404(__NAME, __SYM, _decimals) Ownable(initialOwner_) ERC404UniswapV3Exempt(_uniswapV3Router) { // Do not mint the ERC721s to the initial owner, as it's a waste of gas. _setERC721TransferExempt(initialMintRecipient_, true); _mintERC20(initialMintRecipient_, _maxTotalSupplyERC721 * units); _baseUri = "ipfs://QmaZayMhEmhKKqDHoXHMMd1SMic5wpXvJWa2KeyfEz8RM7/"; _websiteUri = "https://PORTAL404.io"; _contractUri = string( abi.encodePacked( '{"name": "Portal-404","description": A collection of ', _maxTotalSupplyERC721.toString(), ' ERC-404 Tokens enhanced with ERC-5169 + TokenScript"","image": "ipfs://Qmf8Qi6oapx8sce1kPa6aiFUMzCpm869D1RpeGYinEwtgo"}' ) ); } function contractURI() public view returns (string memory) { return _contractUri; } function tokenURI(uint256 id) public view override returns (string memory) { uint8 seed = uint8(bytes1(keccak256(abi.encodePacked(id)))); string memory image; string memory color; if (seed <= 100) { image = "blue.gif"; color = "Blue"; } else if (seed <= 150) { image = "green.gif"; color = "Green"; } else if (seed <= 200) { image = "yellow.gif"; color = "Yellow"; } else if (seed <= 230) { image = "indigo.gif"; color = "Indigo"; } else if (seed <= 248) { image = "red.gif"; color = "Red"; } else { image = "obsidian.gif"; color = "Obsidian"; } return string( abi.encodePacked( '{"name": "Portal-404 #', id.toString(), '","description":"A collection of ', _maxTotalSupplyERC721.toString(), " ERC-404 Tokens enhanced with ERC-5169 & TokenScript", '","external_url":"', _websiteUri, '","image":"', _baseUri, image, '","attributes":[{"trait_type":"Color","value":"', color, '"}]}' ) ); } function setTransferExempt( address account_, bool value_ ) external onlyOwner { _setERC721TransferExempt(account_, value_); emit Set721TransferExempt(account_); } function setWebsiteUrl(string memory newUri) public onlyOwner { _websiteUri = newUri; emit WebsiteUrlUpdate(newUri); } function setBaseURI(string memory newUri) public onlyOwner { _baseUri = newUri; emit BaseUriUpdate(newUri); } function setContractURI(string memory newUri) public onlyOwner { _contractUri = newUri; emit ContractUriUpdate(newUri); } // Supply ERC5159 and ERC404 type function supportsInterface( bytes4 interfaceId ) public view override(ERC5169, ERC404) returns (bool) { return ERC5169.supportsInterface(interfaceId) || ERC404.supportsInterface(interfaceId); } // ERC-5169 function _authorizeSetScripts( string[] memory ) internal view override(ERC5169) onlyOwner {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721Receiver.sol) pragma solidity ^0.8.20; import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// 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: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Immutable state /// @notice Functions that return immutable state of the router interface IPeripheryImmutableState { /// @return Returns the address of the Uniswap V3 factory function factory() external view returns (address); /// @return Returns the address of WETH9 function WETH9() external view returns (address); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; import {IERC404} from "./interfaces/IERC404.sol"; import {DoubleEndedQueue} from "./lib/DoubleEndedQueue.sol"; import {ERC721Events} from "./lib/ERC721Events.sol"; import {ERC20Events} from "./lib/ERC20Events.sol"; abstract contract ERC404 is IERC404 { using DoubleEndedQueue for DoubleEndedQueue.Uint256Deque; /// @dev The queue of ERC-721 tokens stored in the contract. DoubleEndedQueue.Uint256Deque private _storedERC721Ids; /// @dev Token name string public name; /// @dev Token symbol string public symbol; /// @dev Decimals for ERC-20 representation uint8 public immutable decimals; /// @dev Units for ERC-20 representation uint256 public immutable units; /// @dev Total supply in ERC-20 representation uint256 public totalSupply; /// @dev Current mint counter which also represents the highest /// minted id, monotonically increasing to ensure accurate ownership uint256 public minted; /// @dev Initial chain id for EIP-2612 support uint256 internal immutable _INITIAL_CHAIN_ID; /// @dev Initial domain separator for EIP-2612 support bytes32 internal immutable _INITIAL_DOMAIN_SEPARATOR; /// @dev Balance of user in ERC-20 representation mapping(address => uint256) public balanceOf; /// @dev Allowance of user in ERC-20 representation mapping(address => mapping(address => uint256)) public allowance; /// @dev Approval in ERC-721 representaion mapping(uint256 => address) public getApproved; /// @dev Approval for all in ERC-721 representation mapping(address => mapping(address => bool)) public isApprovedForAll; /// @dev Packed representation of ownerOf and owned indices mapping(uint256 => uint256) internal _ownedData; /// @dev Array of owned ids in ERC-721 representation mapping(address => uint256[]) internal _owned; /// @dev Addresses that are exempt from ERC-721 transfer, typically for gas savings (pairs, routers, etc) mapping(address => bool) internal _erc721TransferExempt; /// @dev EIP-2612 nonces mapping(address => uint256) public nonces; /// @dev Address bitmask for packed ownership data uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; /// @dev Owned index bitmask for packed ownership data uint256 private constant _BITMASK_OWNED_INDEX = ((1 << 96) - 1) << 160; /// @dev Constant for token id encoding uint256 public constant ID_ENCODING_PREFIX = 1 << 255; constructor(string memory name_, string memory symbol_, uint8 decimals_) { name = name_; symbol = symbol_; if (decimals_ < 18) { revert DecimalsTooLow(); } decimals = decimals_; units = 10 ** decimals; // EIP-2612 initialization _INITIAL_CHAIN_ID = block.chainid; _INITIAL_DOMAIN_SEPARATOR = _computeDomainSeparator(); } /// @notice Function to find owner of a given ERC-721 token function ownerOf( uint256 id_ ) public view virtual returns (address erc721Owner) { erc721Owner = _getOwnerOf(id_); // If the id_ is beyond the range of minted tokens, is 0, or the token is not owned by anyone, revert. if (id_ <= ID_ENCODING_PREFIX || erc721Owner == address(0)) { revert NotFound(); } } function owned( address owner_ ) public view virtual returns (uint256[] memory) { return _owned[owner_]; } function erc721BalanceOf( address owner_ ) public view virtual returns (uint256) { return _owned[owner_].length; } function erc20BalanceOf( address owner_ ) public view virtual returns (uint256) { return balanceOf[owner_]; } function erc20TotalSupply() public view virtual returns (uint256) { return totalSupply; } function erc721TotalSupply() public view virtual returns (uint256) { return minted; } function getERC721QueueLength() public view virtual returns (uint256) { return _storedERC721Ids.length(); } function getERC721TokensInQueue( uint256 start_, uint256 count_ ) public view virtual returns (uint256[] memory) { uint256[] memory tokensInQueue = new uint256[](count_); for (uint256 i = start_; i < start_ + count_; ) { tokensInQueue[i - start_] = _storedERC721Ids.at(i); unchecked { ++i; } } return tokensInQueue; } /// @notice tokenURI must be implemented by child contract function tokenURI(uint256 id_) public view virtual returns (string memory); /// @notice Function for token approvals /// @dev This function assumes the operator is attempting to approve an ERC-721 /// if valueOrId is less than the minted count. Unlike setApprovalForAll, /// spender_ must be allowed to be 0x0 so that approval can be revoked. function approve( address spender_, uint256 valueOrId_ ) public virtual returns (bool) { // The ERC-721 tokens are 1-indexed, so 0 is not a valid id and indicates that // operator is attempting to set the ERC-20 allowance to 0. if ( valueOrId_ > ID_ENCODING_PREFIX && valueOrId_ != type(uint256).max ) { erc721Approve(spender_, valueOrId_); } else { return erc20Approve(spender_, valueOrId_); } return true; } function erc721Approve(address spender_, uint256 id_) public virtual { // Intention is to approve as ERC-721 token (id). address erc721Owner = _getOwnerOf(id_); if ( msg.sender != erc721Owner && !isApprovedForAll[erc721Owner][msg.sender] ) { revert Unauthorized(); } getApproved[id_] = spender_; emit ERC721Events.Approval(erc721Owner, spender_, id_); } /// @dev Providing type(uint256).max for approval value results in an /// unlimited approval that is not deducted from on transfers. function erc20Approve( address spender_, uint256 value_ ) public virtual returns (bool) { // Prevent granting 0x0 an ERC-20 allowance. if (spender_ == address(0)) { revert InvalidSpender(); } // Intention is to approve as ERC-20 token (value). allowance[msg.sender][spender_] = value_; emit ERC20Events.Approval(msg.sender, spender_, value_); return true; } /// @notice Function for ERC-721 approvals function setApprovalForAll( address operator_, bool approved_ ) public virtual { // Prevent approvals to 0x0. if (operator_ == address(0)) { revert InvalidOperator(); } isApprovedForAll[msg.sender][operator_] = approved_; emit ERC721Events.ApprovalForAll(msg.sender, operator_, approved_); } /// @notice Function for mixed transfers from an operator that may be different than 'from'. /// @dev This function assumes the operator is attempting to transfer an ERC-721 /// if valueOrId is less than or equal to current max id. function transferFrom( address from_, address to_, uint256 valueOrId_ ) public virtual returns (bool) { if (valueOrId_ > ID_ENCODING_PREFIX) { erc721TransferFrom(from_, to_, valueOrId_); } else { // Intention is to transfer as ERC-20 token (value). return erc20TransferFrom(from_, to_, valueOrId_); } return true; } /// @notice Function for ERC-721 transfers from. /// @dev This function is recommended for ERC721 transfers function erc721TransferFrom( address from_, address to_, uint256 id_ ) public virtual { // Prevent transferring tokens from 0x0. if (from_ == address(0)) { revert InvalidSender(); } // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } if (from_ != _getOwnerOf(id_)) { revert Unauthorized(); } // Check that the operator is either the sender or approved for the transfer. if ( msg.sender != from_ && !isApprovedForAll[from_][msg.sender] && msg.sender != getApproved[id_] ) { revert Unauthorized(); } if (erc721TransferExempt(to_)) { revert RecipientIsERC721TransferExempt(); } // Transfer 1 * units ERC-20 and 1 ERC-721 token. // ERC-721 transfer exemptions handled above. Can't make it to this point if either is transfer exempt. _transferERC20(from_, to_, units); _transferERC721(from_, to_, id_); } /// @notice Function for ERC-20 transfers from. /// @dev This function is recommended for ERC20 transfers function erc20TransferFrom( address from_, address to_, uint256 value_ ) public virtual returns (bool) { // Prevent transferring tokens from 0x0. if (from_ == address(0)) { revert InvalidSender(); } // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } // Intention is to transfer as ERC-20 token (value). uint256 allowed = allowance[from_][msg.sender]; // Check that the operator has sufficient allowance. if (allowed != type(uint256).max) { allowance[from_][msg.sender] = allowed - value_; } // Transferring ERC-20s directly requires the _transfer function. // Handles ERC-721 exemptions internally. return _transferERC20WithERC721(from_, to_, value_); } /// @notice Function for ERC-20 transfers. /// @dev This function assumes the operator is attempting to transfer as ERC-20 /// given this function is only supported on the ERC-20 interface. /// Treats even small amounts that are valid ERC-721 ids as ERC-20s. function transfer( address to_, uint256 value_ ) public virtual returns (bool) { // Prevent burning tokens to 0x0. if (to_ == address(0)) { revert InvalidRecipient(); } // Transferring ERC-20s directly requires the _transfer function. // Handles ERC-721 exemptions internally. return _transferERC20WithERC721(msg.sender, to_, value_); } /// @notice Function for ERC-721 transfers with contract support. /// This function only supports moving valid ERC-721 ids, as it does not exist on the ERC-20 /// spec and will revert otherwise. function safeTransferFrom( address from_, address to_, uint256 id_ ) public virtual { safeTransferFrom(from_, to_, id_, ""); } /// @notice Function for ERC-721 transfers with contract support and callback data. /// This function only supports moving valid ERC-721 ids, as it does not exist on the /// ERC-20 spec and will revert otherwise. function safeTransferFrom( address from_, address to_, uint256 id_, bytes memory data_ ) public virtual { if (id_ <= ID_ENCODING_PREFIX) { revert InvalidId(); } transferFrom(from_, to_, id_); if ( to_.code.length != 0 && IERC721Receiver(to_).onERC721Received( msg.sender, from_, id_, data_ ) != IERC721Receiver.onERC721Received.selector ) { revert UnsafeRecipient(); } } /// @notice Function for EIP-2612 permits /// @dev Providing type(uint256).max for permit value results in an /// unlimited approval that is not deducted from on transfers. function permit( address owner_, address spender_, uint256 value_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_ ) public virtual { if (deadline_ < block.timestamp) { revert PermitDeadlineExpired(); } if (value_ > ID_ENCODING_PREFIX && value_ != type(uint256).max) { revert InvalidApproval(); } if (spender_ == address(0)) { revert InvalidSpender(); } unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner_, spender_, value_, nonces[owner_]++, deadline_ ) ) ) ), v_, r_, s_ ); if (recoveredAddress == address(0) || recoveredAddress != owner_) { revert InvalidSigner(); } allowance[recoveredAddress][spender_] = value_; } emit ERC20Events.Approval(owner_, spender_, value_); } /// @notice Returns domain initial domain separator, or recomputes if chain id is not equal to initial chain id function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == _INITIAL_CHAIN_ID ? _INITIAL_DOMAIN_SEPARATOR : _computeDomainSeparator(); } function supportsInterface( bytes4 interfaceId ) public view virtual returns (bool) { return interfaceId == type(IERC404).interfaceId || interfaceId == type(IERC165).interfaceId; } /// @notice Function for self-exemption function setSelfERC721TransferExempt(bool state_) public virtual { _setERC721TransferExempt(msg.sender, state_); } /// @notice Function to check if address is transfer exempt function erc721TransferExempt( address target_ ) public view virtual returns (bool) { return target_ == address(0) || _erc721TransferExempt[target_]; } /// @notice Internal function to compute domain separator for EIP-2612 permits function _computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /// @notice This is the lowest level ERC-20 transfer function, which /// should be used for both normal ERC-20 transfers as well as minting. /// Note that this function allows transfers to and from 0x0. function _transferERC20( address from_, address to_, uint256 value_ ) internal virtual { // Minting is a special case for which we should not check the balance of // the sender, and we should increase the total supply. if (from_ == address(0)) { totalSupply += value_; } else { // Deduct value from sender's balance. balanceOf[from_] -= value_; } // Update the recipient's balance. // Can be unchecked because on mint, adding to totalSupply is checked, and on transfer balance deduction is checked. unchecked { balanceOf[to_] += value_; } emit ERC20Events.Transfer(from_, to_, value_); } /// @notice Consolidated record keeping function for transferring ERC-721s. /// @dev Assign the token to the new owner, and remove from the old owner. /// Note that this function allows transfers to and from 0x0. /// Does not handle ERC-721 exemptions. function _transferERC721( address from_, address to_, uint256 id_ ) internal virtual { // If this is not a mint, handle record keeping for transfer from previous owner. if (from_ != address(0)) { // On transfer of an NFT, any previous approval is reset. delete getApproved[id_]; uint256 updatedId = _owned[from_][_owned[from_].length - 1]; if (updatedId != id_) { uint256 updatedIndex = _getOwnedIndex(id_); // update _owned for sender _owned[from_][updatedIndex] = updatedId; // update index for the moved id _setOwnedIndex(updatedId, updatedIndex); } // pop _owned[from_].pop(); } // Check if this is a burn. if (to_ != address(0)) { // If not a burn, update the owner of the token to the new owner. // Update owner of the token to the new owner. _setOwnerOf(id_, to_); // Push token onto the new owner's stack. _owned[to_].push(id_); // Update index for new owner's stack. _setOwnedIndex(id_, _owned[to_].length - 1); } else { // If this is a burn, reset the owner of the token to 0x0 by deleting the token from _ownedData. delete _ownedData[id_]; } emit ERC721Events.Transfer(from_, to_, id_); } function calculateERC721Transfers( address from_, uint256 value_ ) public view returns (uint256[] memory tokenIds) { //first check it's possible to send this value uint256 erc20BalanceOfSenderBefore = erc20BalanceOf(from_); if (!erc721TransferExempt(from_)) { uint256 nftsToTransfer = value_ / units; uint256 fractionalAmount = value_ % units; //account for fractional NFT removal if ( (erc20BalanceOfSenderBefore - fractionalAmount) / units < (erc20BalanceOfSenderBefore / units) ) { nftsToTransfer++; } if (nftsToTransfer > 0) { tokenIds = new uint256[](nftsToTransfer); for (uint256 i = 0; i < nftsToTransfer; i++) { // Pop from sender's ERC-721 stack and transfer them (LIFO) uint256 indexOfLastToken = _owned[from_].length - (1 + i); tokenIds[i] = _owned[from_][indexOfLastToken]; } } } } /// @notice Internal function for ERC-20 transfers. Also handles any ERC-721 transfers that may be required. // Handles ERC-721 exemptions. function _transferERC20WithERC721( address from_, address to_, uint256 value_ ) internal virtual returns (bool) { uint256 erc20BalanceOfSenderBefore = erc20BalanceOf(from_); uint256 erc20BalanceOfReceiverBefore = erc20BalanceOf(to_); _transferERC20(from_, to_, value_); // Preload for gas savings on branches bool isFromERC721TransferExempt = erc721TransferExempt(from_); bool isToERC721TransferExempt = erc721TransferExempt(to_); // Skip _withdrawAndStoreERC721 and/or _retrieveOrMintERC721 for ERC-721 transfer exempt addresses // 1) to save gas // 2) because ERC-721 transfer exempt addresses won't always have/need ERC-721s corresponding to their ERC20s. if (isFromERC721TransferExempt && isToERC721TransferExempt) { // Case 1) Both sender and recipient are ERC-721 transfer exempt. No ERC-721s need to be transferred. // NOOP. } else if (isFromERC721TransferExempt) { // Case 2) The sender is ERC-721 transfer exempt, but the recipient is not. Contract should not attempt // to transfer ERC-721s from the sender, but the recipient should receive ERC-721s // from the bank/minted for any whole number increase in their balance. // Only cares about whole number increments. uint256 tokensToRetrieveOrMint = (balanceOf[to_] / units) - (erc20BalanceOfReceiverBefore / units); for (uint256 i = 0; i < tokensToRetrieveOrMint; ) { _retrieveOrMintERC721(to_); unchecked { ++i; } } } else if (isToERC721TransferExempt) { // Case 3) The sender is not ERC-721 transfer exempt, but the recipient is. Contract should attempt // to withdraw and store ERC-721s from the sender, but the recipient should not // receive ERC-721s from the bank/minted. // Only cares about whole number increments. uint256 tokensToWithdrawAndStore = (erc20BalanceOfSenderBefore / units) - (balanceOf[from_] / units); for (uint256 i = 0; i < tokensToWithdrawAndStore; ) { _withdrawAndStoreERC721(from_); unchecked { ++i; } } } else { // Case 4) Neither the sender nor the recipient are ERC-721 transfer exempt. // Strategy: // 1. First deal with the whole tokens. These are easy and will just be transferred. // 2. Look at the fractional part of the value: // a) If it causes the sender to lose a whole token that was represented by an NFT due to a // fractional part being transferred, withdraw and store an additional NFT from the sender. // b) If it causes the receiver to gain a whole new token that should be represented by an NFT // due to receiving a fractional part that completes a whole token, retrieve or mint an NFT to the recevier. // Whole tokens worth of ERC-20s get transferred as ERC-721s without any burning/minting. uint256 nftsToTransfer = value_ / units; for (uint256 i = 0; i < nftsToTransfer; ) { // Pop from sender's ERC-721 stack and transfer them (LIFO) uint256 indexOfLastToken = _owned[from_].length - 1; uint256 tokenId = _owned[from_][indexOfLastToken]; _transferERC721(from_, to_, tokenId); unchecked { ++i; } } // If the sender's transaction changes their holding from a fractional to a non-fractional // amount (or vice versa), adjust ERC-721s. // // Check if the send causes the sender to lose a whole token that was represented by an ERC-721 // due to a fractional part being transferred. if ( erc20BalanceOfSenderBefore / units - erc20BalanceOf(from_) / units > nftsToTransfer ) { _withdrawAndStoreERC721(from_); } if ( erc20BalanceOf(to_) / units - erc20BalanceOfReceiverBefore / units > nftsToTransfer ) { _retrieveOrMintERC721(to_); } } return true; } /// @notice Internal function for ERC20 minting /// @dev This function will allow minting of new ERC20s. /// If mintCorrespondingERC721s_ is true, and the recipient is not ERC-721 exempt, it will /// also mint the corresponding ERC721s. /// Handles ERC-721 exemptions. function _mintERC20(address to_, uint256 value_) internal virtual { /// You cannot mint to the zero address (you can't mint and immediately burn in the same transfer). if (to_ == address(0)) { revert InvalidRecipient(); } if (totalSupply + value_ > ID_ENCODING_PREFIX) { revert MintLimitReached(); } _transferERC20WithERC721(address(0), to_, value_); } /// @notice Internal function for ERC-721 minting and retrieval from the bank. /// @dev This function will allow minting of new ERC-721s up to the total fractional supply. It will /// first try to pull from the bank, and if the bank is empty, it will mint a new token. /// Does not handle ERC-721 exemptions. function _retrieveOrMintERC721(address to_) internal virtual { if (to_ == address(0)) { revert InvalidRecipient(); } uint256 id; if (!_storedERC721Ids.empty()) { // If there are any tokens in the bank, use those first. // Pop off the end of the queue (FIFO). id = _storedERC721Ids.popBack(); } else { // Otherwise, mint a new token, should not be able to go over the total fractional supply. ++minted; // Reserve max uint256 for approvals if (minted == type(uint256).max) { revert MintLimitReached(); } id = ID_ENCODING_PREFIX + minted; } address erc721Owner = _getOwnerOf(id); // The token should not already belong to anyone besides 0x0 or this contract. // If it does, something is wrong, as this should never happen. if (erc721Owner != address(0)) { revert AlreadyExists(); } // Transfer the token to the recipient, either transferring from the contract's bank or minting. // Does not handle ERC-721 exemptions. _transferERC721(erc721Owner, to_, id); } /// @notice Internal function for ERC-721 deposits to bank (this contract). /// @dev This function will allow depositing of ERC-721s to the bank, which can be retrieved by future minters. // Does not handle ERC-721 exemptions. function _withdrawAndStoreERC721(address from_) internal virtual { if (from_ == address(0)) { revert InvalidSender(); } // Retrieve the latest token added to the owner's stack (LIFO). uint256 id = _owned[from_][_owned[from_].length - 1]; // Transfer to 0x0. // Does not handle ERC-721 exemptions. _transferERC721(from_, address(0), id); // Record the token in the contract's bank queue. _storedERC721Ids.pushFront(id); } /// @notice Initialization function to set pairs / etc, saving gas by avoiding mint / burn on unnecessary targets function _setERC721TransferExempt( address target_, bool state_ ) internal virtual { // Adjust the ERC721 balances of the target to respect exemption rules. // Despite this logic, it is still recommended practice to exempt prior to the target // having an active balance. if (state_) { _clearERC721Balance(target_); } else { _reinstateERC721Balance(target_); } _erc721TransferExempt[target_] = state_; } /// @notice Function to reinstate balance on exemption removal function _reinstateERC721Balance(address target_) private { uint256 expectedERC721Balance = erc20BalanceOf(target_) / units; uint256 actualERC721Balance = erc721BalanceOf(target_); for (uint256 i = 0; i < expectedERC721Balance - actualERC721Balance; ) { // Transfer ERC721 balance in from pool _retrieveOrMintERC721(target_); unchecked { ++i; } } } /// @notice Function to clear balance on exemption inclusion function _clearERC721Balance(address target_) private { uint256 erc721Balance = erc721BalanceOf(target_); for (uint256 i = 0; i < erc721Balance; ) { // Transfer out ERC721 balance _withdrawAndStoreERC721(target_); unchecked { ++i; } } } function _getOwnerOf( uint256 id_ ) internal view virtual returns (address ownerOf_) { uint256 data = _ownedData[id_]; assembly { ownerOf_ := and(data, _BITMASK_ADDRESS) } } function _setOwnerOf(uint256 id_, address owner_) internal virtual { uint256 data = _ownedData[id_]; assembly { data := add( and(data, _BITMASK_OWNED_INDEX), and(owner_, _BITMASK_ADDRESS) ) } _ownedData[id_] = data; } function _getOwnedIndex( uint256 id_ ) internal view virtual returns (uint256 ownedIndex_) { uint256 data = _ownedData[id_]; assembly { ownedIndex_ := shr(160, data) } } function _setOwnedIndex(uint256 id_, uint256 index_) internal virtual { uint256 data = _ownedData[id_]; if (index_ > _BITMASK_OWNED_INDEX >> 160) { revert OwnedIndexOverflow(); } assembly { data := add( and(data, _BITMASK_ADDRESS), and(shl(160, index_), _BITMASK_OWNED_INDEX) ) } _ownedData[id_] = data; } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {ERC404} from "../ERC404.sol"; import {IPeripheryImmutableState} from "@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol"; abstract contract ERC404UniswapV3Exempt is ERC404 { constructor(address uniswapV3Router_) { IPeripheryImmutableState uniswapV3Router = IPeripheryImmutableState( uniswapV3Router_ ); // Set the Uniswap v3 swap router as exempt. _setERC721TransferExempt(uniswapV3Router_, true); uint24[3] memory feeTiers = [uint24(500), uint24(3_000), uint24(10_000)]; // Determine the Uniswap v3 pair address for this token. for (uint256 i = 0; i < feeTiers.length; ) { address uniswapV3Pair = _getUniswapV3Pair( uniswapV3Router.factory(), uniswapV3Router.WETH9(), feeTiers[i] ); // Set the Uniswap v3 pair as exempt. _setERC721TransferExempt(uniswapV3Pair, true); unchecked { ++i; } } } function _getUniswapV3Pair( address uniswapV3Factory_, address weth_, uint24 fee_ ) private view returns (address) { address thisAddress = address(this); (address token0, address token1) = thisAddress < weth_ ? (thisAddress, weth_) : (weth_, thisAddress); return address( uint160( uint256( keccak256( abi.encodePacked( hex"ff", uniswapV3Factory_, keccak256(abi.encode(token0, token1, fee_)), hex"e34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54" ) ) ) ) ); } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; interface IERC404 is IERC165 { error NotFound(); error InvalidId(); error AlreadyExists(); error InvalidRecipient(); error InvalidSender(); error InvalidSpender(); error InvalidOperator(); error UnsafeRecipient(); error RecipientIsERC721TransferExempt(); error Unauthorized(); error InsufficientAllowance(); error DecimalsTooLow(); error PermitDeadlineExpired(); error InvalidSigner(); error InvalidApproval(); error OwnedIndexOverflow(); error MintLimitReached(); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function erc20TotalSupply() external view returns (uint256); function erc721TotalSupply() external view returns (uint256); function balanceOf(address owner_) external view returns (uint256); function erc721BalanceOf(address owner_) external view returns (uint256); function erc20BalanceOf(address owner_) external view returns (uint256); function erc721TransferExempt(address account_) external view returns (bool); function isApprovedForAll( address owner_, address operator_ ) external view returns (bool); function allowance( address owner_, address spender_ ) external view returns (uint256); function owned(address owner_) external view returns (uint256[] memory); function ownerOf(uint256 id_) external view returns (address erc721Owner); function tokenURI(uint256 id_) external view returns (string memory); function approve( address spender_, uint256 valueOrId_ ) external returns (bool); function erc20Approve( address spender_, uint256 value_ ) external returns (bool); function erc721Approve(address spender_, uint256 id_) external; function setApprovalForAll(address operator_, bool approved_) external; function transferFrom( address from_, address to_, uint256 valueOrId_ ) external returns (bool); function erc20TransferFrom( address from_, address to_, uint256 value_ ) external returns (bool); function erc721TransferFrom(address from_, address to_, uint256 id_) external; function transfer(address to_, uint256 amount_) external returns (bool); function getERC721QueueLength() external view returns (uint256); function getERC721TokensInQueue( uint256 start_, uint256 count_ ) external view returns (uint256[] memory); function setSelfERC721TransferExempt(bool state_) external; function safeTransferFrom(address from_, address to_, uint256 id_) external; function safeTransferFrom( address from_, address to_, uint256 id_, bytes calldata data_ ) external; function DOMAIN_SEPARATOR() external view returns (bytes32); function permit( address owner_, address spender_, uint256 value_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_ ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/DoubleEndedQueue.sol) // Modified by Pandora Labs to support native uint256 operations pragma solidity ^0.8.20; /** * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that * the existing queue contents are left in storage. * * The struct is called `Uint256Deque`. This data structure can only be used in storage, and not in memory. * * ```solidity * DoubleEndedQueue.Uint256Deque queue; * ``` */ library DoubleEndedQueue { /** * @dev An operation (e.g. {front}) couldn't be completed due to the queue being empty. */ error QueueEmpty(); /** * @dev A push operation couldn't be completed due to the queue being full. */ error QueueFull(); /** * @dev An operation (e.g. {at}) couldn't be completed due to an index being out of bounds. */ error QueueOutOfBounds(); /** * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access. * * Struct members have an underscore prefix indicating that they are "private" and should not be read or written to * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and * lead to unexpected behavior. * * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around. */ struct Uint256Deque { uint128 _begin; uint128 _end; mapping(uint128 index => uint256) _data; } /** * @dev Inserts an item at the end of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushBack(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 backIndex = deque._end; if (backIndex + 1 == deque._begin) revert QueueFull(); deque._data[backIndex] = value; deque._end = backIndex + 1; } } /** * @dev Removes the item at the end of the queue and returns it. * * Reverts with {QueueEmpty} if the queue is empty. */ function popBack( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 backIndex = deque._end; if (backIndex == deque._begin) revert QueueEmpty(); --backIndex; value = deque._data[backIndex]; delete deque._data[backIndex]; deque._end = backIndex; } } /** * @dev Inserts an item at the beginning of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushFront(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 frontIndex = deque._begin - 1; if (frontIndex == deque._end) revert QueueFull(); deque._data[frontIndex] = value; deque._begin = frontIndex; } } /** * @dev Removes the item at the beginning of the queue and returns it. * * Reverts with `QueueEmpty` if the queue is empty. */ function popFront( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 frontIndex = deque._begin; if (frontIndex == deque._end) revert QueueEmpty(); value = deque._data[frontIndex]; delete deque._data[frontIndex]; deque._begin = frontIndex + 1; } } /** * @dev Returns the item at the beginning of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function front( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); return deque._data[deque._begin]; } /** * @dev Returns the item at the end of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function back( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); unchecked { return deque._data[deque._end - 1]; } } /** * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at * `length(deque) - 1`. * * Reverts with `QueueOutOfBounds` if the index is out of bounds. */ function at( Uint256Deque storage deque, uint256 index ) internal view returns (uint256 value) { if (index >= length(deque)) revert QueueOutOfBounds(); // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128 unchecked { return deque._data[deque._begin + uint128(index)]; } } /** * @dev Resets the queue back to being empty. * * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses * out on potential gas refunds. */ function clear(Uint256Deque storage deque) internal { deque._begin = 0; deque._end = 0; } /** * @dev Returns the number of items in the queue. */ function length(Uint256Deque storage deque) internal view returns (uint256) { unchecked { return uint256(deque._end - deque._begin); } } /** * @dev Returns true if the queue is empty. */ function empty(Uint256Deque storage deque) internal view returns (bool) { return deque._end == deque._begin; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; library ERC20Events { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 amount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; library ERC721Events { event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); event Approval( address indexed owner, address indexed spender, uint256 indexed id ); event Transfer( address indexed from, address indexed to, uint256 indexed id ); }
/* Attestation decode and validation */ /* AlphaWallet 2021 - 2022 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.16; import "./IERC5169.sol"; abstract contract ERC5169 is IERC5169 { string[] private _scriptURI; function scriptURI() external view override returns (string[] memory) { return _scriptURI; } function setScriptURI(string[] memory newScriptURI) external override { _authorizeSetScripts(newScriptURI); _scriptURI = newScriptURI; emit ScriptUpdate(newScriptURI); } function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC5169).interfaceId; } /** * @dev Function that should revert when `msg.sender` is not authorized to set script URI. Called by * {setScriptURI}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeSetScripts(string[] memory) internal override onlyOwner {} * ``` */ function _authorizeSetScripts(string[] memory newScriptURI) internal virtual; }
/* Attestation decode and validation */ /* AlphaWallet 2021 - 2022 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IERC5169 { /// @dev This event emits when the scriptURI is updated, /// so wallets implementing this interface can update a cached script event ScriptUpdate(string[]); /// @notice Get the scriptURI for the contract /// @return The scriptURI function scriptURI() external view returns (string[] memory); /// @notice Update the scriptURI /// emits event ScriptUpdate(string[]) function setScriptURI(string[] memory) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"initialOwner_","type":"address"},{"internalType":"address","name":"initialMintRecipient_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExists","type":"error"},{"inputs":[],"name":"DecimalsTooLow","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InvalidApproval","type":"error"},{"inputs":[],"name":"InvalidId","type":"error"},{"inputs":[],"name":"InvalidOperator","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidSpender","type":"error"},{"inputs":[],"name":"MintLimitReached","type":"error"},{"inputs":[],"name":"NotFound","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnedIndexOverflow","type":"error"},{"inputs":[],"name":"PermitDeadlineExpired","type":"error"},{"inputs":[],"name":"QueueEmpty","type":"error"},{"inputs":[],"name":"QueueFull","type":"error"},{"inputs":[],"name":"QueueOutOfBounds","type":"error"},{"inputs":[],"name":"RecipientIsERC721TransferExempt","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsafeRecipient","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":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"BaseUriUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"ContractUriUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string[]","name":"","type":"string[]"}],"name":"ScriptUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"txExempt","type":"address"}],"name":"Set721TransferExempt","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"WebsiteUrlUpdate","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ID_ENCODING_PREFIX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"valueOrId_","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"calculateERC721Transfers","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"erc20Approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"erc20BalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc20TotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"erc20TransferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"erc721Approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"erc721BalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc721TotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target_","type":"address"}],"name":"erc721TransferExempt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"erc721TransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getERC721QueueLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start_","type":"uint256"},{"internalType":"uint256","name":"count_","type":"uint256"}],"name":"getERC721TokensInQueue","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"owned","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"erc721Owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"spender_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"uint256","name":"deadline_","type":"uint256"},{"internalType":"uint8","name":"v_","type":"uint8"},{"internalType":"bytes32","name":"r_","type":"bytes32"},{"internalType":"bytes32","name":"s_","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scriptURI","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator_","type":"address"},{"internalType":"bool","name":"approved_","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"newScriptURI","type":"string[]"}],"name":"setScriptURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state_","type":"bool"}],"name":"setSelfERC721TransferExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"bool","name":"value_","type":"bool"}],"name":"setTransferExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"}],"name":"setWebsiteUrl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","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":"valueOrId_","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"units","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101006040526127106010553480156200001857600080fd5b50604051620047c0380380620047c08339810160408190526200003b91620010b9565b60408051808201825260098152681413d49510530d0c0d60ba1b6020808301919091528251808401909352600583526414150d0c0d60da1b9083015273e592427a0aece92de3edee1f18e0157c05861564916012856001600160a01b038116620000bf57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000ca816200036d565b506003620000d9848262001195565b506004620000e8838262001195565b5060128160ff1610156200010f576040516398790fd560e01b815260040160405180910390fd5b60ff811660808190526200012590600a62001374565b60a0524660c05262000136620003bd565b60e052508291506200014c905081600162000459565b604080516060810182526101f48152610bb860208201526127109181019190915260005b6003811015620002835760006200026a846001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e591906200138c565b856001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200024a91906200138c565b8585600381106200025f576200025f620013aa565b6020020151620004a7565b90506200027981600162000459565b5060010162000170565b505050506200029a8160016200045960201b60201c565b620002b78160a051601054620002b19190620013c0565b620005a9565b6040518060600160405280603681526020016200476a60369139601290620002e0908262001195565b5060408051808201909152601481527f68747470733a2f2f504f5254414c3430342e696f000000000000000000000000602082015260119062000324908262001195565b50601054620003339062000619565b604051602001620003459190620013da565b6040516020818303038152906040526013908162000364919062001195565b505050620015f0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6003604051620003f19190620014f1565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b801562000471576200046b82620006b2565b6200047c565b6200047c82620006ea565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b60003081806001600160a01b0386168310620004c5578583620004c8565b82865b604080516001600160a01b03808516602083015283169181019190915262ffffff881660608201529193509150879060800160405160208183030381529060405280519060200120604051602001620005869291907fff00000000000000000000000000000000000000000000000000000000000000815260609290921b6001600160601b031916600183015260158201527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54603582015260550190565b60408051601f198184030181529190528051602090910120979650505050505050565b6001600160a01b038216620005d157604051634e46966960e11b815260040160405180910390fd5b600160ff1b81600554620005e691906200156f565b1115620006065760405163303b682f60e01b815260040160405180910390fd5b620006146000838362000773565b505050565b60606000620006288362000a22565b60010190506000816001600160401b038111156200064a576200064a620010f1565b6040519080825280601f01601f19166020018201604052801562000675576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846200067f57509392505050565b6001600160a01b0381166000908152600c6020526040812054905b818110156200061457620006e18362000b0c565b600101620006cd565b60a05160009062000710836001600160a01b031660009081526007602052604090205490565b6200071c919062001585565b9050600062000740836001600160a01b03166000908152600c602052604090205490565b905060005b620007518284620015a8565b8110156200076d57620007648462000ba1565b60010162000745565b50505050565b6001600160a01b03838116600090815260076020526040808220549285168252812054909190620007a686868662000c97565b6000620007b38762000d49565b90506000620007c28762000d49565b9050818015620007cf5750805b62000a145781156200084b57600060a05184620007ed919062001585565b60a0516001600160a01b038a1660009081526007602052604090205462000815919062001585565b620008219190620015a8565b905060005b8181101562000843576200083a8962000ba1565b60010162000826565b505062000a14565b8015620008b85760a0516001600160a01b03891660009081526007602052604081205490916200087b9162001585565b60a0516200088a908762001585565b620008969190620015a8565b905060005b818110156200084357620008af8a62000b0c565b6001016200089b565b600060a05187620008ca919062001585565b905060005b818110156200095c576001600160a01b038a166000908152600c6020526040812054620008ff90600190620015a8565b6001600160a01b038c166000908152600c602052604081208054929350909183908110620009315762000931620013aa565b90600052602060002001549050620009518c8c8362000d7c60201b60201c565b5050600101620008cf565b5060a0518190620009828b6001600160a01b031660009081526007602052604090205490565b6200098e919062001585565b60a0516200099d908862001585565b620009a99190620015a8565b1115620009bb57620009bb8962000b0c565b8060a05185620009cc919062001585565b60a0516001600160a01b038b16600090815260076020526040902054620009f4919062001585565b62000a009190620015a8565b111562000a125762000a128862000ba1565b505b506001979650505050505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062000a6c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062000a99576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831062000ab857662386f26fc10000830492506010015b6305f5e100831062000ad1576305f5e100830492506008015b612710831062000ae657612710830492506004015b6064831062000af9576064830492506002015b600a831062000b06576001015b92915050565b6001600160a01b03811662000b3457604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c60205260408120805462000b5c90600190620015a8565b8154811062000b6f5762000b6f620013aa565b9060005260206000200154905062000b908260008362000d7c60201b60201c565b62000b9d60018262000f58565b5050565b6001600160a01b03811662000bc957604051634e46966960e11b815260040160405180910390fd5b600062000bea600154600160801b81046001600160801b0390811691161490565b62000c035762000bfb600162000fc3565b905062000c52565b60066000815462000c1490620015be565b9091555060065460010162000c3c5760405163303b682f60e01b815260040160405180910390fd5b60065462000c4f90600160ff1b6200156f565b90505b6000818152600b60205260409020546001600160a01b0316801562000c8a5760405163119b4fd360e11b815260040160405180910390fd5b6200061481848462000d7c565b6001600160a01b03831662000cc657806005600082825462000cba91906200156f565b9091555062000cf69050565b6001600160a01b0383166000908152600760205260408120805483929062000cf0908490620015a8565b90915550505b6001600160a01b0380831660008181526007602052604090819020805485019055519091851690600080516020620047a08339815191529062000d3c9085815260200190565b60405180910390a3505050565b60006001600160a01b038216158062000b065750506001600160a01b03166000908152600d602052604090205460ff1690565b6001600160a01b0383161562000e9657600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c9091528120805462000dce90600190620015a8565b8154811062000de15762000de1620013aa565b9060005260206000200154905081811462000e54576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c60205260409020805491925083918390811062000e3a5762000e3a620013aa565b60009182526020909120015562000e52828262001034565b505b6001600160a01b0384166000908152600c6020526040902080548062000e7e5762000e7e620015da565b60019003818190600052602060002001600090559055505b6001600160a01b0382161562000f13576000818152600b6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600c8352908320805460018181018355828652938520018590559252905462000f0d91839162000f079190620015a8565b62001034565b62000f23565b6000818152600b60205260408120555b80826001600160a01b0316846001600160a01b0316600080516020620047a083398151915260405160405180910390a4505050565b81546001600160801b038082166000190191600160801b900481169082160362000f9557604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b0316600081815260018401602052604090209190915581546001600160801b031916179055565b80546000906001600160801b03600160801b820481169116810362000ffb576040516375e52f4f60e01b815260040160405180910390fd5b600019016001600160801b039081166000818152600185016020526040812080549190558454909216600160801b909102179092555090565b6000828152600b60205260409020546001600160601b038211156200106c57604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b80516001600160a01b0381168114620010b457600080fd5b919050565b60008060408385031215620010cd57600080fd5b620010d8836200109c565b9150620010e8602084016200109c565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200111c57607f821691505b6020821081036200113d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200061457600081815260208120601f850160051c810160208610156200116c5750805b601f850160051c820191505b818110156200118d5782815560010162001178565b505050505050565b81516001600160401b03811115620011b157620011b1620010f1565b620011c981620011c2845462001107565b8462001143565b602080601f831160018114620012015760008415620011e85750858301515b600019600386901b1c1916600185901b1785556200118d565b600085815260208120601f198616915b82811015620012325788860151825594840194600190910190840162001211565b5085821015620012515787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620012b85781600019048211156200129c576200129c62001261565b80851615620012aa57918102915b93841c93908002906200127c565b509250929050565b600082620012d15750600162000b06565b81620012e05750600062000b06565b8160018114620012f95760028114620013045762001324565b600191505062000b06565b60ff84111562001318576200131862001261565b50506001821b62000b06565b5060208310610133831016604e8410600b841016171562001349575081810a62000b06565b62001355838362001277565b80600019048211156200136c576200136c62001261565b029392505050565b60006200138560ff841683620012c0565b9392505050565b6000602082840312156200139f57600080fd5b62001385826200109c565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141762000b065762000b0662001261565b7f7b226e616d65223a2022506f7274616c2d343034222c226465736372697074698152600060207f6f6e223a204120636f6c6c656374696f6e206f6620000000000000000000000081840152835160005b8181101562001449578581018301518582016035015282016200142b565b507f204552432d34303420546f6b656e7320656e68616e63656420776974682045526035949091019384015250507f432d35313639202b20546f6b656e53637269707422222c22696d616765223a2060558201527f22697066733a2f2f516d66385169366f61707838736365316b5061366169465560758201527f4d7a43706d38363944315270654759696e457774676f227d0000000000000000609582015260ad01919050565b6000808354620015018162001107565b600182811680156200151c5760018114620015325762001563565b60ff198416875282151583028701945062001563565b8760005260208060002060005b858110156200155a5781548a8201529084019082016200153f565b50505082870194505b50929695505050505050565b8082018082111562000b065762000b0662001261565b600082620015a357634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111562000b065762000b0662001261565b600060018201620015d357620015d362001261565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516130d76200169360003960006108a4015260006108740152600081816104f5015281816114cf01528181611704015281816117320152818161175e0152818161178501528181611b5401528181611b9801528181611c1101528181611c3b01528181611c8f01528181611d3b01528181611d7201528181611db601528181611ddd015261220a0152600061039301526130d76000f3fe608060405234801561001057600080fd5b50600436106102a05760003560e01c80638a696e5011610167578063c87b56dd116100ce578063e3d61eb311610087578063e3d61eb31461063e578063e8a3d48514610651578063e985e9c514610659578063f2fde38b14610687578063f31af7511461069a578063f780bc1a146106ad57600080fd5b8063c87b56dd146105b4578063d505accf146105c7578063d96ca0b9146105da578063dd62ed3e146105ed578063dd63769914610618578063dfabc0331461062b57600080fd5b8063a9059cbb11610120578063a9059cbb1461052a578063adb372771461053d578063b1ab931714610550578063b3f9ea3414610570578063b88d4fde14610599578063c5ab3ba6146105ac57600080fd5b80638a696e50146104b15780638da5cb5b146104c4578063938e3d7b146104d557806395d89b41146104e8578063976a8435146104f0578063a22cb4651461051757600080fd5b806342842e0e1161020b5780636e8f624b116101c45780636e8f624b1461044357806370a082311461044e578063715018a61461046e5780637ecebe0014610476578063884227d61461049657806389fb4c66146104a957600080fd5b806342842e0e146103d75780634bb30912146103ec5780634d966072146104015780634f02c4201461041457806355f804b31461041d5780636352211e1461043057600080fd5b806309f0ef651161025d57806309f0ef651461035f57806318160ddd1461037257806323b872dd1461037b578063313ce5671461038e5780633644e515146103c75780633e63eb2a146103cf57600080fd5b806301ffc9a7146102a557806302519da3146102cd57806306fdde03146102ee578063081812fc14610303578063095ea7b31461034457806309674eb014610357575b600080fd5b6102b86102b33660046126ed565b6106c0565b60405190151581526020015b60405180910390f35b6102e06102db366004612721565b6106eb565b6040519081526020016102c4565b6102f6610706565b6040516102c4919061278c565b61032c61031136600461279f565b6009602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016102c4565b6102b86103523660046127b8565b610794565b6102e06107d9565b6102b861036d366004612721565b610803565b6102e060055481565b6102b86103893660046127e2565b610835565b6103b57f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016102c4565b6102e0610870565b6102f66108c6565b6103ea6103e53660046127e2565b6108d3565b005b6103f46108f3565b6040516102c4919061281e565b6102b861040f3660046127b8565b6109cc565b6102e060065481565b6103ea61042b36600461293f565b610a59565b61032c61043e36600461279f565b610aa8565b6102e0600160ff1b81565b6102e061045c366004612721565b60076020526000908152604090205481565b6103ea610afd565b6102e0610484366004612721565b600e6020526000908152604090205481565b6103ea6104a436600461298c565b610b11565b6005546102e0565b6103ea6104bf3660046129bf565b610b63565b6000546001600160a01b031661032c565b6103ea6104e336600461293f565b610b70565b6102f6610bb4565b6102e07f000000000000000000000000000000000000000000000000000000000000000081565b6103ea61052536600461298c565b610bc1565b6102b86105383660046127b8565b610c54565b6103ea61054b36600461293f565b610c88565b61056361055e366004612721565b610ccc565b6040516102c491906129da565b6102e061057e366004612721565b6001600160a01b03166000908152600c602052604090205490565b6103ea6105a7366004612a1e565b610d38565b6006546102e0565b6102f66105c236600461279f565b610e24565b6103ea6105d5366004612a9a565b61108e565b6102b86105e83660046127e2565b6112dd565b6102e06105fb366004612b0d565b600860209081526000928352604080842090915290825290205481565b6103ea6106263660046127e2565b61139d565b6103ea6106393660046127b8565b6114fe565b6103ea61064c366004612b37565b6115c3565b6102f661160f565b6102b8610667366004612b0d565b600a60209081526000928352604080842090915290825290205460ff1681565b6103ea610695366004612721565b6116a1565b6105636106a83660046127b8565b6116e1565b6105636106bb366004612bfa565b6118c7565b600063a86517a160e01b6001600160e01b0319831614806106e557506106e582611964565b92915050565b6001600160a01b031660009081526007602052604090205490565b6003805461071390612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461073f90612c1c565b801561078c5780601f106107615761010080835404028352916020019161078c565b820191906000526020600020905b81548152906001019060200180831161076f57829003601f168201915b505050505081565b6000600160ff1b821180156107ab57506000198214155b156107bf576107ba83836114fe565b6107d0565b6107c983836109cc565b90506106e5565b50600192915050565b60006107fe6001546001600160801b03808216600160801b9092048116919091031690565b905090565b60006001600160a01b03821615806106e55750506001600160a01b03166000908152600d602052604090205460ff1690565b6000600160ff1b8211156108535761084e84848461139d565b610865565b61085e8484846112dd565b9050610869565b5060015b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146108a1576107fe61199a565b507f000000000000000000000000000000000000000000000000000000000000000090565b6012805461071390612c1c565b6108ee83838360405180602001604052806000815250610d38565b505050565b6060600f805480602002602001604051908101604052809291908181526020016000905b828210156109c357838290600052602060002001805461093690612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461096290612c1c565b80156109af5780601f10610984576101008083540402835291602001916109af565b820191906000526020600020905b81548152906001019060200180831161099257829003601f168201915b505050505081526020019060010190610917565b50505050905090565b60006001600160a01b0383166109f557604051635461585f60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b610a61611a34565b6012610a6d8282612ca4565b507fc35611e34b3940869a5132c8bc8ec4854192b0bfea25d0b9b38bcdeec2c09a7f81604051610a9d919061278c565b60405180910390a150565b6000818152600b60205260409020546001600160a01b0316600160ff1b82111580610ada57506001600160a01b038116155b15610af85760405163c5723b5160e01b815260040160405180910390fd5b919050565b610b05611a34565b610b0f6000611a61565b565b610b19611a34565b610b238282611ab1565b6040516001600160a01b03831681527faef2ab7dcd203d2ff5491f0a944d68c51240463b9ce8ed19ed03553c9388ab8f9060200160405180910390a15050565b610b6d3382611ab1565b50565b610b78611a34565b6013610b848282612ca4565b507f64bfd3486f8e2ca3ff32185781da2d47a93b9558c530e5f9a6252159f247bb9981604051610a9d919061278c565b6004805461071390612c1c565b6001600160a01b038216610be85760405163ccea9e6f60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006001600160a01b038316610c7d57604051634e46966960e11b815260040160405180910390fd5b610869338484611af9565b610c90611a34565b6011610c9c8282612ca4565b507f854688aed50c7cd8dede398f6a91506b8ea525d4319afa0c5bbd28babd5eb24481604051610a9d919061278c565b6001600160a01b0381166000908152600c6020908152604091829020805483518184028101840190945280845260609392830182828015610d2c57602002820191906000526020600020905b815481526020019060010190808311610d18575b50505050509050919050565b600160ff1b8211610d5c57604051631bf4348160e31b815260040160405180910390fd5b610d67848484610835565b506001600160a01b0383163b15801590610e005750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a0290610db0903390899088908890600401612d64565b6020604051808303816000875af1158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df39190612da1565b6001600160e01b03191614155b15610e1e57604051633da6393160e01b815260040160405180910390fd5b50505050565b6060600082604051602001610e3b91815260200190565b6040516020818303038152906040528051906020012060f81c905060608060648360ff1611610eab576040518060400160405280600881526020016731363ab29733b4b360c11b815250915060405180604001604052806004815260200163426c756560e01b8152509050611046565b60968360ff1611610eff576040518060400160405280600981526020016833b932b2b71733b4b360b91b81525091506040518060400160405280600581526020016423b932b2b760d91b8152509050611046565b60c88360ff1611610f55576040518060400160405280600a8152602001693cb2b63637bb9733b4b360b11b81525091506040518060400160405280600681526020016559656c6c6f7760d01b8152509050611046565b60e68360ff1611610fab576040518060400160405280600a81526020016934b73234b3b79733b4b360b11b815250915060405180604001604052806006815260200165496e6469676f60d01b8152509050611046565b60f88360ff1611610ffb57604051806040016040528060078152602001663932b21733b4b360c91b81525091506040518060400160405280600381526020016214995960ea1b8152509050611046565b6040518060400160405280600c81526020016b37b139b4b234b0b71733b4b360a11b81525091506040518060400160405280600881526020016727b139b4b234b0b760c11b81525090505b61104f85611e38565b61105a601054611e38565b60116012858560405160200161107596959493929190612e4a565b6040516020818303038152906040529350505050919050565b428410156110af576040516305787bdf60e01b815260040160405180910390fd5b600160ff1b851180156110c457506000198514155b156110e2576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b03861661110957604051635461585f60e01b815260040160405180910390fd5b60006001611115610870565b6001600160a01b038a81166000818152600e602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015611221573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615806112565750876001600160a01b0316816001600160a01b031614155b1561127457604051632057875960e21b815260040160405180910390fd5b6001600160a01b0390811660009081526008602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006001600160a01b03841661130657604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b03831661132d57604051634e46966960e11b815260040160405180910390fd5b6001600160a01b03841660009081526008602090815260408083203384529091529020546000198114611389576113648382612fec565b6001600160a01b03861660009081526008602090815260408083203384529091529020555b611394858585611af9565b95945050505050565b6001600160a01b0383166113c457604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166113eb57604051634e46966960e11b815260040160405180910390fd5b6000818152600b60205260409020546001600160a01b03848116911614611424576040516282b42960e81b815260040160405180910390fd5b336001600160a01b0384161480159061146157506001600160a01b0383166000908152600a6020908152604080832033845290915290205460ff16155b801561148457506000818152600960205260409020546001600160a01b03163314155b156114a1576040516282b42960e81b815260040160405180910390fd5b6114aa82610803565b156114c857604051635ce7539760e01b815260040160405180910390fd5b6114f383837f0000000000000000000000000000000000000000000000000000000000000000611ecb565b6108ee838383611f87565b6000818152600b60205260409020546001600160a01b031633811480159061154a57506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff16155b15611567576040516282b42960e81b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6115cc8161215f565b80516115df90600f90602084019061261a565b507f9538911740e5519a40db77fb5f637de0d56cdd804318d81ae270cc24fbd8479e81604051610a9d919061281e565b60606013805461161e90612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461164a90612c1c565b80156116975780601f1061166c57610100808354040283529160200191611697565b820191906000526020600020905b81548152906001019060200180831161167a57829003601f168201915b5050505050905090565b6116a9611a34565b6001600160a01b0381166116d857604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6d81611a61565b606060006116ee846106eb565b90506116f984610803565b6118c05760006117297f000000000000000000000000000000000000000000000000000000000000000085613015565b905060006117577f000000000000000000000000000000000000000000000000000000000000000086613029565b90506117837f000000000000000000000000000000000000000000000000000000000000000084613015565b7f00000000000000000000000000000000000000000000000000000000000000006117ae8386612fec565b6117b89190613015565b10156117cc57816117c88161303d565b9250505b81156118bd578167ffffffffffffffff8111156117eb576117eb612880565b604051908082528060200260200182016040528015611814578160200160208202803683370190505b50935060005b828110156118bb57600061182f826001613056565b6001600160a01b0389166000908152600c60205260409020546118529190612fec565b6001600160a01b0389166000908152600c602052604090208054919250908290811061188057611880613069565b906000526020600020015486838151811061189d5761189d613069565b602090810291909101015250806118b38161303d565b91505061181a565b505b50505b5092915050565b606060008267ffffffffffffffff8111156118e4576118e4612880565b60405190808252806020026020018201604052801561190d578160200160208202803683370190505b509050835b61191c8486613056565b81101561195c5761192e600182612167565b826119398784612fec565b8151811061194957611949613069565b6020908102919091010152600101611912565b509392505050565b60006001600160e01b0319821663caf91ff560e01b14806106e557506001600160e01b031982166301ffc9a760e01b1492915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60036040516119cc919061307f565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000546001600160a01b03163314610b0f5760405163118cdaa760e01b81523360048201526024016116cf565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8015611ac557611ac0826121d2565b611ace565b611ace82612206565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b600080611b05856106eb565b90506000611b12856106eb565b9050611b1f868686611ecb565b6000611b2a87610803565b90506000611b3787610803565b9050818015611b435750805b611e2a578115611bec576000611b797f000000000000000000000000000000000000000000000000000000000000000085613015565b6001600160a01b038916600090815260076020526040902054611bbd907f000000000000000000000000000000000000000000000000000000000000000090613015565b611bc79190612fec565b905060005b81811015611be557611bdd89612286565b600101611bcc565b5050611e2a565b8015611c88576001600160a01b038816600090815260076020526040812054611c36907f000000000000000000000000000000000000000000000000000000000000000090613015565b611c607f000000000000000000000000000000000000000000000000000000000000000087613015565b611c6a9190612fec565b905060005b81811015611be557611c808a61236e565b600101611c6f565b6000611cb47f000000000000000000000000000000000000000000000000000000000000000088613015565b905060005b81811015611d37576001600160a01b038a166000908152600c6020526040812054611ce690600190612fec565b6001600160a01b038c166000908152600c602052604081208054929350909183908110611d1557611d15613069565b90600052602060002001549050611d2d8c8c83611f87565b5050600101611cb9565b50807f0000000000000000000000000000000000000000000000000000000000000000611d638b6106eb565b611d6d9190613015565b611d977f000000000000000000000000000000000000000000000000000000000000000088613015565b611da19190612fec565b1115611db057611db08961236e565b80611ddb7f000000000000000000000000000000000000000000000000000000000000000086613015565b7f0000000000000000000000000000000000000000000000000000000000000000611e058b6106eb565b611e0f9190613015565b611e199190612fec565b1115611e2857611e2888612286565b505b506001979650505050505050565b60606000611e45836123f3565b600101905060008167ffffffffffffffff811115611e6557611e65612880565b6040519080825280601f01601f191660200182016040528015611e8f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e9957509392505050565b6001600160a01b038316611ef6578060056000828254611eeb9190613056565b90915550611f249050565b6001600160a01b03831660009081526007602052604081208054839290611f1e908490612fec565b90915550505b6001600160a01b03808316600081815260076020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611f7a9085815260200190565b60405180910390a3505050565b6001600160a01b0383161561209257600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c90915281208054611fd690600190612fec565b81548110611fe657611fe6613069565b90600052602060002001549050818114612053576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c60205260409020805491925083918390811061203b5761203b613069565b60009182526020909120015561205182826124cb565b505b6001600160a01b0384166000908152600c6020526040902080548061207a5761207a61308b565b60019003818190600052602060002001600090559055505b6001600160a01b03821615612109576000818152600b6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600c835290832080546001818101835582865293852001859055925290546121049183916120ff9190612fec565b6124cb565b612119565b6000818152600b60205260408120555b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b610b6d611a34565b600061218b83546001600160801b03808216600160801b9092048116919091031690565b82106121aa5760405163580821e760e01b815260040160405180910390fd5b5081546001600160801b03908116820116600090815260018301602052604090205492915050565b6001600160a01b0381166000908152600c6020526040812054905b818110156108ee576121fe8361236e565b6001016121ed565b60007f0000000000000000000000000000000000000000000000000000000000000000612232836106eb565b61223c9190613015565b9050600061225f836001600160a01b03166000908152600c602052604090205490565b905060005b61226e8284612fec565b811015610e1e5761227e84612286565b600101612264565b6001600160a01b0381166122ad57604051634e46966960e11b815260040160405180910390fd5b60006122cd600154600160801b81046001600160801b0390811691161490565b6122e2576122db6001612537565b905061232c565b6006600081546122f19061303d565b909155506006546001016123185760405163303b682f60e01b815260040160405180910390fd5b60065461232990600160ff1b613056565b90505b6000818152600b60205260409020546001600160a01b031680156123635760405163119b4fd360e11b815260040160405180910390fd5b6108ee818484611f87565b6001600160a01b03811661239557604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c6020526040812080546123bb90600190612fec565b815481106123cb576123cb613069565b906000526020600020015490506123e482600083611f87565b6123ef6001826125a7565b5050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124325772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061245e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061247c57662386f26fc10000830492506010015b6305f5e1008310612494576305f5e100830492506008015b61271083106124a857612710830492506004015b606483106124ba576064830492506002015b600a83106106e55760010192915050565b6000828152600b60205260409020546bffffffffffffffffffffffff82111561250757604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b80546000906001600160801b03600160801b820481169116810361256e576040516375e52f4f60e01b815260040160405180910390fd5b600019016001600160801b039081166000818152600185016020526040812080549190558454909216600160801b909102179092555090565b81546001600160801b038082166000190191600160801b90048116908216036125e357604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b0316600081815260018401602052604090209190915581546fffffffffffffffffffffffffffffffff1916179055565b828054828255906000526020600020908101928215612660579160200282015b8281111561266057825182906126509082612ca4565b509160200191906001019061263a565b5061266c929150612670565b5090565b8082111561266c576000612684828261268d565b50600101612670565b50805461269990612c1c565b6000825580601f106126a9575050565b601f016020900490600052602060002090810190610b6d91905b8082111561266c57600081556001016126c3565b6001600160e01b031981168114610b6d57600080fd5b6000602082840312156126ff57600080fd5b8135610869816126d7565b80356001600160a01b0381168114610af857600080fd5b60006020828403121561273357600080fd5b6108698261270a565b60005b8381101561275757818101518382015260200161273f565b50506000910152565b6000815180845261277881602086016020860161273c565b601f01601f19169290920160200192915050565b6020815260006108696020830184612760565b6000602082840312156127b157600080fd5b5035919050565b600080604083850312156127cb57600080fd5b6127d48361270a565b946020939093013593505050565b6000806000606084860312156127f757600080fd5b6128008461270a565b925061280e6020850161270a565b9150604084013590509250925092565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561287357603f19888603018452612861858351612760565b94509285019290850190600101612845565b5092979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128bf576128bf612880565b604052919050565b600067ffffffffffffffff8311156128e1576128e1612880565b6128f4601f8401601f1916602001612896565b905082815283838301111561290857600080fd5b828260208301376000602084830101529392505050565b600082601f83011261293057600080fd5b610869838335602085016128c7565b60006020828403121561295157600080fd5b813567ffffffffffffffff81111561296857600080fd5b6129748482850161291f565b949350505050565b80358015158114610af857600080fd5b6000806040838503121561299f57600080fd5b6129a88361270a565b91506129b66020840161297c565b90509250929050565b6000602082840312156129d157600080fd5b6108698261297c565b6020808252825182820181905260009190848201906040850190845b81811015612a12578351835292840192918401916001016129f6565b50909695505050505050565b60008060008060808587031215612a3457600080fd5b612a3d8561270a565b9350612a4b6020860161270a565b925060408501359150606085013567ffffffffffffffff811115612a6e57600080fd5b8501601f81018713612a7f57600080fd5b612a8e878235602084016128c7565b91505092959194509250565b600080600080600080600060e0888a031215612ab557600080fd5b612abe8861270a565b9650612acc6020890161270a565b95506040880135945060608801359350608088013560ff81168114612af057600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612b2057600080fd5b612b298361270a565b91506129b66020840161270a565b60006020808385031215612b4a57600080fd5b823567ffffffffffffffff80821115612b6257600080fd5b818501915085601f830112612b7657600080fd5b813581811115612b8857612b88612880565b8060051b612b97858201612896565b9182528381018501918581019089841115612bb157600080fd5b86860192505b83831015612bed57823585811115612bcf5760008081fd5b612bdd8b89838a010161291f565b8352509186019190860190612bb7565b9998505050505050505050565b60008060408385031215612c0d57600080fd5b50508035926020909101359150565b600181811c90821680612c3057607f821691505b602082108103612c5057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156108ee57600081815260208120601f850160051c81016020861015612c7d5750805b601f850160051c820191505b81811015612c9c57828155600101612c89565b505050505050565b815167ffffffffffffffff811115612cbe57612cbe612880565b612cd281612ccc8454612c1c565b84612c56565b602080601f831160018114612d075760008415612cef5750858301515b600019600386901b1c1916600185901b178555612c9c565b600085815260208120601f198616915b82811015612d3657888601518255948401946001909101908401612d17565b5085821015612d545787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d9790830184612760565b9695505050505050565b600060208284031215612db357600080fd5b8151610869816126d7565b60008151612dd081856020860161273c565b9290920192915050565b60008154612de781612c1c565b60018281168015612dff5760018114612e14576118bb565b60ff19841687528215158302870194506118bb565b8560005260208060002060005b85811015612e3a5781548a820152908401908201612e21565b5050509590910195945050505050565b757b226e616d65223a2022506f7274616c2d343034202360501b81528651600090612e7c816016850160208c0161273c565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f66601691840191820152600160fd1b60368201528751612ec3816037840160208c0161273c565b7f204552432d34303420546f6b656e7320656e68616e6365642077697468204552603792909101918201527310cb4d4c4d8e480988151bdad95b94d8dc9a5c1d60621b60578201527111161132bc3a32b93730b62fbab936111d1160711b606b820152612f33607d820188612dda565b6a11161134b6b0b3b2911d1160a91b81529050612f53600b820187612dda565b90508451612f6581836020890161273c565b612fc8612fb8612fb28385017f222c2261747472696275746573223a5b7b2274726169745f74797065223a224381526e37b637b91116113b30b63ab2911d1160891b6020820152602f0190565b87612dbe565b63227d5d7d60e01b815260040190565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106e5576106e5612fd6565b634e487b7160e01b600052601260045260246000fd5b60008261302457613024612fff565b500490565b60008261303857613038612fff565b500690565b60006001820161304f5761304f612fd6565b5060010190565b808201808211156106e5576106e5612fd6565b634e487b7160e01b600052603260045260246000fd5b60006108698284612dda565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d8c04c1c5c3eb2308f687af8c09b927b053b466582c7d50916e8b6f6c098048a64736f6c63430008140033697066733a2f2f516d615a61794d68456d684b4b7144486f58484d4d6431534d696335777058764a5761324b657966457a38524d372fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102a05760003560e01c80638a696e5011610167578063c87b56dd116100ce578063e3d61eb311610087578063e3d61eb31461063e578063e8a3d48514610651578063e985e9c514610659578063f2fde38b14610687578063f31af7511461069a578063f780bc1a146106ad57600080fd5b8063c87b56dd146105b4578063d505accf146105c7578063d96ca0b9146105da578063dd62ed3e146105ed578063dd63769914610618578063dfabc0331461062b57600080fd5b8063a9059cbb11610120578063a9059cbb1461052a578063adb372771461053d578063b1ab931714610550578063b3f9ea3414610570578063b88d4fde14610599578063c5ab3ba6146105ac57600080fd5b80638a696e50146104b15780638da5cb5b146104c4578063938e3d7b146104d557806395d89b41146104e8578063976a8435146104f0578063a22cb4651461051757600080fd5b806342842e0e1161020b5780636e8f624b116101c45780636e8f624b1461044357806370a082311461044e578063715018a61461046e5780637ecebe0014610476578063884227d61461049657806389fb4c66146104a957600080fd5b806342842e0e146103d75780634bb30912146103ec5780634d966072146104015780634f02c4201461041457806355f804b31461041d5780636352211e1461043057600080fd5b806309f0ef651161025d57806309f0ef651461035f57806318160ddd1461037257806323b872dd1461037b578063313ce5671461038e5780633644e515146103c75780633e63eb2a146103cf57600080fd5b806301ffc9a7146102a557806302519da3146102cd57806306fdde03146102ee578063081812fc14610303578063095ea7b31461034457806309674eb014610357575b600080fd5b6102b86102b33660046126ed565b6106c0565b60405190151581526020015b60405180910390f35b6102e06102db366004612721565b6106eb565b6040519081526020016102c4565b6102f6610706565b6040516102c4919061278c565b61032c61031136600461279f565b6009602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016102c4565b6102b86103523660046127b8565b610794565b6102e06107d9565b6102b861036d366004612721565b610803565b6102e060055481565b6102b86103893660046127e2565b610835565b6103b57f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff90911681526020016102c4565b6102e0610870565b6102f66108c6565b6103ea6103e53660046127e2565b6108d3565b005b6103f46108f3565b6040516102c4919061281e565b6102b861040f3660046127b8565b6109cc565b6102e060065481565b6103ea61042b36600461293f565b610a59565b61032c61043e36600461279f565b610aa8565b6102e0600160ff1b81565b6102e061045c366004612721565b60076020526000908152604090205481565b6103ea610afd565b6102e0610484366004612721565b600e6020526000908152604090205481565b6103ea6104a436600461298c565b610b11565b6005546102e0565b6103ea6104bf3660046129bf565b610b63565b6000546001600160a01b031661032c565b6103ea6104e336600461293f565b610b70565b6102f6610bb4565b6102e07f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6103ea61052536600461298c565b610bc1565b6102b86105383660046127b8565b610c54565b6103ea61054b36600461293f565b610c88565b61056361055e366004612721565b610ccc565b6040516102c491906129da565b6102e061057e366004612721565b6001600160a01b03166000908152600c602052604090205490565b6103ea6105a7366004612a1e565b610d38565b6006546102e0565b6102f66105c236600461279f565b610e24565b6103ea6105d5366004612a9a565b61108e565b6102b86105e83660046127e2565b6112dd565b6102e06105fb366004612b0d565b600860209081526000928352604080842090915290825290205481565b6103ea6106263660046127e2565b61139d565b6103ea6106393660046127b8565b6114fe565b6103ea61064c366004612b37565b6115c3565b6102f661160f565b6102b8610667366004612b0d565b600a60209081526000928352604080842090915290825290205460ff1681565b6103ea610695366004612721565b6116a1565b6105636106a83660046127b8565b6116e1565b6105636106bb366004612bfa565b6118c7565b600063a86517a160e01b6001600160e01b0319831614806106e557506106e582611964565b92915050565b6001600160a01b031660009081526007602052604090205490565b6003805461071390612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461073f90612c1c565b801561078c5780601f106107615761010080835404028352916020019161078c565b820191906000526020600020905b81548152906001019060200180831161076f57829003601f168201915b505050505081565b6000600160ff1b821180156107ab57506000198214155b156107bf576107ba83836114fe565b6107d0565b6107c983836109cc565b90506106e5565b50600192915050565b60006107fe6001546001600160801b03808216600160801b9092048116919091031690565b905090565b60006001600160a01b03821615806106e55750506001600160a01b03166000908152600d602052604090205460ff1690565b6000600160ff1b8211156108535761084e84848461139d565b610865565b61085e8484846112dd565b9050610869565b5060015b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000146146108a1576107fe61199a565b507f41dca92f75a4a687f99e2cbeed325e2b7c7a7725cc98fd8668238938c79a78f190565b6012805461071390612c1c565b6108ee83838360405180602001604052806000815250610d38565b505050565b6060600f805480602002602001604051908101604052809291908181526020016000905b828210156109c357838290600052602060002001805461093690612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461096290612c1c565b80156109af5780601f10610984576101008083540402835291602001916109af565b820191906000526020600020905b81548152906001019060200180831161099257829003601f168201915b505050505081526020019060010190610917565b50505050905090565b60006001600160a01b0383166109f557604051635461585f60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350600192915050565b610a61611a34565b6012610a6d8282612ca4565b507fc35611e34b3940869a5132c8bc8ec4854192b0bfea25d0b9b38bcdeec2c09a7f81604051610a9d919061278c565b60405180910390a150565b6000818152600b60205260409020546001600160a01b0316600160ff1b82111580610ada57506001600160a01b038116155b15610af85760405163c5723b5160e01b815260040160405180910390fd5b919050565b610b05611a34565b610b0f6000611a61565b565b610b19611a34565b610b238282611ab1565b6040516001600160a01b03831681527faef2ab7dcd203d2ff5491f0a944d68c51240463b9ce8ed19ed03553c9388ab8f9060200160405180910390a15050565b610b6d3382611ab1565b50565b610b78611a34565b6013610b848282612ca4565b507f64bfd3486f8e2ca3ff32185781da2d47a93b9558c530e5f9a6252159f247bb9981604051610a9d919061278c565b6004805461071390612c1c565b6001600160a01b038216610be85760405163ccea9e6f60e01b815260040160405180910390fd5b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006001600160a01b038316610c7d57604051634e46966960e11b815260040160405180910390fd5b610869338484611af9565b610c90611a34565b6011610c9c8282612ca4565b507f854688aed50c7cd8dede398f6a91506b8ea525d4319afa0c5bbd28babd5eb24481604051610a9d919061278c565b6001600160a01b0381166000908152600c6020908152604091829020805483518184028101840190945280845260609392830182828015610d2c57602002820191906000526020600020905b815481526020019060010190808311610d18575b50505050509050919050565b600160ff1b8211610d5c57604051631bf4348160e31b815260040160405180910390fd5b610d67848484610835565b506001600160a01b0383163b15801590610e005750604051630a85bd0160e11b808252906001600160a01b0385169063150b7a0290610db0903390899088908890600401612d64565b6020604051808303816000875af1158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df39190612da1565b6001600160e01b03191614155b15610e1e57604051633da6393160e01b815260040160405180910390fd5b50505050565b6060600082604051602001610e3b91815260200190565b6040516020818303038152906040528051906020012060f81c905060608060648360ff1611610eab576040518060400160405280600881526020016731363ab29733b4b360c11b815250915060405180604001604052806004815260200163426c756560e01b8152509050611046565b60968360ff1611610eff576040518060400160405280600981526020016833b932b2b71733b4b360b91b81525091506040518060400160405280600581526020016423b932b2b760d91b8152509050611046565b60c88360ff1611610f55576040518060400160405280600a8152602001693cb2b63637bb9733b4b360b11b81525091506040518060400160405280600681526020016559656c6c6f7760d01b8152509050611046565b60e68360ff1611610fab576040518060400160405280600a81526020016934b73234b3b79733b4b360b11b815250915060405180604001604052806006815260200165496e6469676f60d01b8152509050611046565b60f88360ff1611610ffb57604051806040016040528060078152602001663932b21733b4b360c91b81525091506040518060400160405280600381526020016214995960ea1b8152509050611046565b6040518060400160405280600c81526020016b37b139b4b234b0b71733b4b360a11b81525091506040518060400160405280600881526020016727b139b4b234b0b760c11b81525090505b61104f85611e38565b61105a601054611e38565b60116012858560405160200161107596959493929190612e4a565b6040516020818303038152906040529350505050919050565b428410156110af576040516305787bdf60e01b815260040160405180910390fd5b600160ff1b851180156110c457506000198514155b156110e2576040516303e7c1bd60e31b815260040160405180910390fd5b6001600160a01b03861661110957604051635461585f60e01b815260040160405180910390fd5b60006001611115610870565b6001600160a01b038a81166000818152600e602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015611221573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615806112565750876001600160a01b0316816001600160a01b031614155b1561127457604051632057875960e21b815260040160405180910390fd5b6001600160a01b0390811660009081526008602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006001600160a01b03841661130657604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b03831661132d57604051634e46966960e11b815260040160405180910390fd5b6001600160a01b03841660009081526008602090815260408083203384529091529020546000198114611389576113648382612fec565b6001600160a01b03861660009081526008602090815260408083203384529091529020555b611394858585611af9565b95945050505050565b6001600160a01b0383166113c457604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166113eb57604051634e46966960e11b815260040160405180910390fd5b6000818152600b60205260409020546001600160a01b03848116911614611424576040516282b42960e81b815260040160405180910390fd5b336001600160a01b0384161480159061146157506001600160a01b0383166000908152600a6020908152604080832033845290915290205460ff16155b801561148457506000818152600960205260409020546001600160a01b03163314155b156114a1576040516282b42960e81b815260040160405180910390fd5b6114aa82610803565b156114c857604051635ce7539760e01b815260040160405180910390fd5b6114f383837f0000000000000000000000000000000000000000000000000de0b6b3a7640000611ecb565b6108ee838383611f87565b6000818152600b60205260409020546001600160a01b031633811480159061154a57506001600160a01b0381166000908152600a6020908152604080832033845290915290205460ff16155b15611567576040516282b42960e81b815260040160405180910390fd5b60008281526009602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6115cc8161215f565b80516115df90600f90602084019061261a565b507f9538911740e5519a40db77fb5f637de0d56cdd804318d81ae270cc24fbd8479e81604051610a9d919061281e565b60606013805461161e90612c1c565b80601f016020809104026020016040519081016040528092919081815260200182805461164a90612c1c565b80156116975780601f1061166c57610100808354040283529160200191611697565b820191906000526020600020905b81548152906001019060200180831161167a57829003601f168201915b5050505050905090565b6116a9611a34565b6001600160a01b0381166116d857604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6d81611a61565b606060006116ee846106eb565b90506116f984610803565b6118c05760006117297f0000000000000000000000000000000000000000000000000de0b6b3a764000085613015565b905060006117577f0000000000000000000000000000000000000000000000000de0b6b3a764000086613029565b90506117837f0000000000000000000000000000000000000000000000000de0b6b3a764000084613015565b7f0000000000000000000000000000000000000000000000000de0b6b3a76400006117ae8386612fec565b6117b89190613015565b10156117cc57816117c88161303d565b9250505b81156118bd578167ffffffffffffffff8111156117eb576117eb612880565b604051908082528060200260200182016040528015611814578160200160208202803683370190505b50935060005b828110156118bb57600061182f826001613056565b6001600160a01b0389166000908152600c60205260409020546118529190612fec565b6001600160a01b0389166000908152600c602052604090208054919250908290811061188057611880613069565b906000526020600020015486838151811061189d5761189d613069565b602090810291909101015250806118b38161303d565b91505061181a565b505b50505b5092915050565b606060008267ffffffffffffffff8111156118e4576118e4612880565b60405190808252806020026020018201604052801561190d578160200160208202803683370190505b509050835b61191c8486613056565b81101561195c5761192e600182612167565b826119398784612fec565b8151811061194957611949613069565b6020908102919091010152600101611912565b509392505050565b60006001600160e01b0319821663caf91ff560e01b14806106e557506001600160e01b031982166301ffc9a760e01b1492915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60036040516119cc919061307f565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000546001600160a01b03163314610b0f5760405163118cdaa760e01b81523360048201526024016116cf565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8015611ac557611ac0826121d2565b611ace565b611ace82612206565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b600080611b05856106eb565b90506000611b12856106eb565b9050611b1f868686611ecb565b6000611b2a87610803565b90506000611b3787610803565b9050818015611b435750805b611e2a578115611bec576000611b797f0000000000000000000000000000000000000000000000000de0b6b3a764000085613015565b6001600160a01b038916600090815260076020526040902054611bbd907f0000000000000000000000000000000000000000000000000de0b6b3a764000090613015565b611bc79190612fec565b905060005b81811015611be557611bdd89612286565b600101611bcc565b5050611e2a565b8015611c88576001600160a01b038816600090815260076020526040812054611c36907f0000000000000000000000000000000000000000000000000de0b6b3a764000090613015565b611c607f0000000000000000000000000000000000000000000000000de0b6b3a764000087613015565b611c6a9190612fec565b905060005b81811015611be557611c808a61236e565b600101611c6f565b6000611cb47f0000000000000000000000000000000000000000000000000de0b6b3a764000088613015565b905060005b81811015611d37576001600160a01b038a166000908152600c6020526040812054611ce690600190612fec565b6001600160a01b038c166000908152600c602052604081208054929350909183908110611d1557611d15613069565b90600052602060002001549050611d2d8c8c83611f87565b5050600101611cb9565b50807f0000000000000000000000000000000000000000000000000de0b6b3a7640000611d638b6106eb565b611d6d9190613015565b611d977f0000000000000000000000000000000000000000000000000de0b6b3a764000088613015565b611da19190612fec565b1115611db057611db08961236e565b80611ddb7f0000000000000000000000000000000000000000000000000de0b6b3a764000086613015565b7f0000000000000000000000000000000000000000000000000de0b6b3a7640000611e058b6106eb565b611e0f9190613015565b611e199190612fec565b1115611e2857611e2888612286565b505b506001979650505050505050565b60606000611e45836123f3565b600101905060008167ffffffffffffffff811115611e6557611e65612880565b6040519080825280601f01601f191660200182016040528015611e8f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e9957509392505050565b6001600160a01b038316611ef6578060056000828254611eeb9190613056565b90915550611f249050565b6001600160a01b03831660009081526007602052604081208054839290611f1e908490612fec565b90915550505b6001600160a01b03808316600081815260076020526040908190208054850190555190918516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611f7a9085815260200190565b60405180910390a3505050565b6001600160a01b0383161561209257600081815260096020908152604080832080546001600160a01b03191690556001600160a01b0386168352600c90915281208054611fd690600190612fec565b81548110611fe657611fe6613069565b90600052602060002001549050818114612053576000828152600b602052604081205460a01c6001600160a01b0386166000908152600c60205260409020805491925083918390811061203b5761203b613069565b60009182526020909120015561205182826124cb565b505b6001600160a01b0384166000908152600c6020526040902080548061207a5761207a61308b565b60019003818190600052602060002001600090559055505b6001600160a01b03821615612109576000818152600b6020908152604080832080546001600160a01b0319166001600160a01b038716908101909155808452600c835290832080546001818101835582865293852001859055925290546121049183916120ff9190612fec565b6124cb565b612119565b6000818152600b60205260408120555b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b610b6d611a34565b600061218b83546001600160801b03808216600160801b9092048116919091031690565b82106121aa5760405163580821e760e01b815260040160405180910390fd5b5081546001600160801b03908116820116600090815260018301602052604090205492915050565b6001600160a01b0381166000908152600c6020526040812054905b818110156108ee576121fe8361236e565b6001016121ed565b60007f0000000000000000000000000000000000000000000000000de0b6b3a7640000612232836106eb565b61223c9190613015565b9050600061225f836001600160a01b03166000908152600c602052604090205490565b905060005b61226e8284612fec565b811015610e1e5761227e84612286565b600101612264565b6001600160a01b0381166122ad57604051634e46966960e11b815260040160405180910390fd5b60006122cd600154600160801b81046001600160801b0390811691161490565b6122e2576122db6001612537565b905061232c565b6006600081546122f19061303d565b909155506006546001016123185760405163303b682f60e01b815260040160405180910390fd5b60065461232990600160ff1b613056565b90505b6000818152600b60205260409020546001600160a01b031680156123635760405163119b4fd360e11b815260040160405180910390fd5b6108ee818484611f87565b6001600160a01b03811661239557604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c6020526040812080546123bb90600190612fec565b815481106123cb576123cb613069565b906000526020600020015490506123e482600083611f87565b6123ef6001826125a7565b5050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124325772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061245e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061247c57662386f26fc10000830492506010015b6305f5e1008310612494576305f5e100830492506008015b61271083106124a857612710830492506004015b606483106124ba576064830492506002015b600a83106106e55760010192915050565b6000828152600b60205260409020546bffffffffffffffffffffffff82111561250757604051633f2cd0e360e21b815260040160405180910390fd5b6000928352600b60205260409092206001600160a01b039290921660a09190911b6001600160a01b031916019055565b80546000906001600160801b03600160801b820481169116810361256e576040516375e52f4f60e01b815260040160405180910390fd5b600019016001600160801b039081166000818152600185016020526040812080549190558454909216600160801b909102179092555090565b81546001600160801b038082166000190191600160801b90048116908216036125e357604051638acb5f2760e01b815260040160405180910390fd5b6001600160801b0316600081815260018401602052604090209190915581546fffffffffffffffffffffffffffffffff1916179055565b828054828255906000526020600020908101928215612660579160200282015b8281111561266057825182906126509082612ca4565b509160200191906001019061263a565b5061266c929150612670565b5090565b8082111561266c576000612684828261268d565b50600101612670565b50805461269990612c1c565b6000825580601f106126a9575050565b601f016020900490600052602060002090810190610b6d91905b8082111561266c57600081556001016126c3565b6001600160e01b031981168114610b6d57600080fd5b6000602082840312156126ff57600080fd5b8135610869816126d7565b80356001600160a01b0381168114610af857600080fd5b60006020828403121561273357600080fd5b6108698261270a565b60005b8381101561275757818101518382015260200161273f565b50506000910152565b6000815180845261277881602086016020860161273c565b601f01601f19169290920160200192915050565b6020815260006108696020830184612760565b6000602082840312156127b157600080fd5b5035919050565b600080604083850312156127cb57600080fd5b6127d48361270a565b946020939093013593505050565b6000806000606084860312156127f757600080fd5b6128008461270a565b925061280e6020850161270a565b9150604084013590509250925092565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561287357603f19888603018452612861858351612760565b94509285019290850190600101612845565b5092979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128bf576128bf612880565b604052919050565b600067ffffffffffffffff8311156128e1576128e1612880565b6128f4601f8401601f1916602001612896565b905082815283838301111561290857600080fd5b828260208301376000602084830101529392505050565b600082601f83011261293057600080fd5b610869838335602085016128c7565b60006020828403121561295157600080fd5b813567ffffffffffffffff81111561296857600080fd5b6129748482850161291f565b949350505050565b80358015158114610af857600080fd5b6000806040838503121561299f57600080fd5b6129a88361270a565b91506129b66020840161297c565b90509250929050565b6000602082840312156129d157600080fd5b6108698261297c565b6020808252825182820181905260009190848201906040850190845b81811015612a12578351835292840192918401916001016129f6565b50909695505050505050565b60008060008060808587031215612a3457600080fd5b612a3d8561270a565b9350612a4b6020860161270a565b925060408501359150606085013567ffffffffffffffff811115612a6e57600080fd5b8501601f81018713612a7f57600080fd5b612a8e878235602084016128c7565b91505092959194509250565b600080600080600080600060e0888a031215612ab557600080fd5b612abe8861270a565b9650612acc6020890161270a565b95506040880135945060608801359350608088013560ff81168114612af057600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612b2057600080fd5b612b298361270a565b91506129b66020840161270a565b60006020808385031215612b4a57600080fd5b823567ffffffffffffffff80821115612b6257600080fd5b818501915085601f830112612b7657600080fd5b813581811115612b8857612b88612880565b8060051b612b97858201612896565b9182528381018501918581019089841115612bb157600080fd5b86860192505b83831015612bed57823585811115612bcf5760008081fd5b612bdd8b89838a010161291f565b8352509186019190860190612bb7565b9998505050505050505050565b60008060408385031215612c0d57600080fd5b50508035926020909101359150565b600181811c90821680612c3057607f821691505b602082108103612c5057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156108ee57600081815260208120601f850160051c81016020861015612c7d5750805b601f850160051c820191505b81811015612c9c57828155600101612c89565b505050505050565b815167ffffffffffffffff811115612cbe57612cbe612880565b612cd281612ccc8454612c1c565b84612c56565b602080601f831160018114612d075760008415612cef5750858301515b600019600386901b1c1916600185901b178555612c9c565b600085815260208120601f198616915b82811015612d3657888601518255948401946001909101908401612d17565b5085821015612d545787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d9790830184612760565b9695505050505050565b600060208284031215612db357600080fd5b8151610869816126d7565b60008151612dd081856020860161273c565b9290920192915050565b60008154612de781612c1c565b60018281168015612dff5760018114612e14576118bb565b60ff19841687528215158302870194506118bb565b8560005260208060002060005b85811015612e3a5781548a820152908401908201612e21565b5050509590910195945050505050565b757b226e616d65223a2022506f7274616c2d343034202360501b81528651600090612e7c816016850160208c0161273c565b7f222c226465736372697074696f6e223a224120636f6c6c656374696f6e206f66601691840191820152600160fd1b60368201528751612ec3816037840160208c0161273c565b7f204552432d34303420546f6b656e7320656e68616e6365642077697468204552603792909101918201527310cb4d4c4d8e480988151bdad95b94d8dc9a5c1d60621b60578201527111161132bc3a32b93730b62fbab936111d1160711b606b820152612f33607d820188612dda565b6a11161134b6b0b3b2911d1160a91b81529050612f53600b820187612dda565b90508451612f6581836020890161273c565b612fc8612fb8612fb28385017f222c2261747472696275746573223a5b7b2274726169745f74797065223a224381526e37b637b91116113b30b63ab2911d1160891b6020820152602f0190565b87612dbe565b63227d5d7d60e01b815260040190565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106e5576106e5612fd6565b634e487b7160e01b600052601260045260246000fd5b60008261302457613024612fff565b500490565b60008261303857613038612fff565b500690565b60006001820161304f5761304f612fd6565b5060010190565b808201808211156106e5576106e5612fd6565b634e487b7160e01b600052603260045260246000fd5b60006108698284612dda565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d8c04c1c5c3eb2308f687af8c09b927b053b466582c7d50916e8b6f6c098048a64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d
-----Decoded View---------------
Arg [0] : initialOwner_ (address): 0xDe5e166f8DafEB7d0d5a58AbFE7397Cad47Cb17D
Arg [1] : initialMintRecipient_ (address): 0xDe5e166f8DafEB7d0d5a58AbFE7397Cad47Cb17D
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d
Arg [1] : 000000000000000000000000de5e166f8dafeb7d0d5a58abfe7397cad47cb17d
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.