{ "language": "Solidity", "sources": { "lib/base64/base64.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0;\n\n/// @title Base64\n/// @author Brecht Devos - \n/// @notice Provides functions for encoding/decoding base64\nlibrary Base64 {\n string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n bytes internal constant TABLE_DECODE = hex\"0000000000000000000000000000000000000000000000000000000000000000\"\n hex\"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000\"\n hex\"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000\"\n hex\"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000\";\n\n function encode(bytes memory data) internal pure returns (string memory) {\n if (data.length == 0) return '';\n\n // load the table into memory\n string memory table = TABLE_ENCODE;\n\n // multiply by 4/3 rounded up\n uint256 encodedLen = 4 * ((data.length + 2) / 3);\n\n // add some extra buffer at the end required for the writing\n string memory result = new string(encodedLen + 32);\n\n assembly {\n // set the actual output length\n mstore(result, encodedLen)\n\n // prepare the lookup table\n let tablePtr := add(table, 1)\n\n // input ptr\n let dataPtr := data\n let endPtr := add(dataPtr, mload(data))\n\n // result ptr, jump over length\n let resultPtr := add(result, 32)\n\n // run over the input, 3 bytes at a time\n for {} lt(dataPtr, endPtr) {}\n {\n // read 3 bytes\n dataPtr := add(dataPtr, 3)\n let input := mload(dataPtr)\n\n // write 4 characters\n mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n resultPtr := add(resultPtr, 1)\n mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n resultPtr := add(resultPtr, 1)\n mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F))))\n resultPtr := add(resultPtr, 1)\n mstore8(resultPtr, mload(add(tablePtr, and( input, 0x3F))))\n resultPtr := add(resultPtr, 1)\n }\n\n // padding with '='\n switch mod(mload(data), 3)\n case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }\n case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }\n }\n\n return result;\n }\n\n function decode(string memory _data) internal pure returns (bytes memory) {\n bytes memory data = bytes(_data);\n\n if (data.length == 0) return new bytes(0);\n require(data.length % 4 == 0, \"invalid base64 decoder input\");\n\n // load the table into memory\n bytes memory table = TABLE_DECODE;\n\n // every 4 characters represent 3 bytes\n uint256 decodedLen = (data.length / 4) * 3;\n\n // add some extra buffer at the end required for the writing\n bytes memory result = new bytes(decodedLen + 32);\n\n assembly {\n // padding with '='\n let lastBytes := mload(add(data, mload(data)))\n if eq(and(lastBytes, 0xFF), 0x3d) {\n decodedLen := sub(decodedLen, 1)\n if eq(and(lastBytes, 0xFFFF), 0x3d3d) {\n decodedLen := sub(decodedLen, 1)\n }\n }\n\n // set the actual output length\n mstore(result, decodedLen)\n\n // prepare the lookup table\n let tablePtr := add(table, 1)\n\n // input ptr\n let dataPtr := data\n let endPtr := add(dataPtr, mload(data))\n\n // result ptr, jump over length\n let resultPtr := add(result, 32)\n\n // run over the input, 4 characters at a time\n for {} lt(dataPtr, endPtr) {}\n {\n // read 4 characters\n dataPtr := add(dataPtr, 4)\n let input := mload(dataPtr)\n\n // write 3 bytes\n let output := add(\n add(\n shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)),\n shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))),\n add(\n shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)),\n and(mload(add(tablePtr, and( input , 0xFF))), 0xFF)\n )\n )\n mstore(resultPtr, shl(232, output))\n resultPtr := add(resultPtr, 3)\n }\n }\n\n return result;\n }\n}\n" }, "lib/openzeppelin-contracts/contracts/utils/Strings.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" }, "lib/openzeppelin-contracts/contracts/utils/math/Math.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" }, "lib/solmate/src/tokens/ERC721.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\n/// @notice Modern, minimalist, and gas efficient ERC-721 implementation.\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol)\nabstract contract ERC721 {\n /*//////////////////////////////////////////////////////////////\n EVENTS\n //////////////////////////////////////////////////////////////*/\n\n event Transfer(address indexed from, address indexed to, uint256 indexed id);\n\n event Approval(address indexed owner, address indexed spender, uint256 indexed id);\n\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /*//////////////////////////////////////////////////////////////\n METADATA STORAGE/LOGIC\n //////////////////////////////////////////////////////////////*/\n\n string public name;\n\n string public symbol;\n\n function tokenURI(uint256 id) public view virtual returns (string memory);\n\n /*//////////////////////////////////////////////////////////////\n ERC721 BALANCE/OWNER STORAGE\n //////////////////////////////////////////////////////////////*/\n\n mapping(uint256 => address) internal _ownerOf;\n\n mapping(address => uint256) internal _balanceOf;\n\n function ownerOf(uint256 id) public view virtual returns (address owner) {\n require((owner = _ownerOf[id]) != address(0), \"NOT_MINTED\");\n }\n\n function balanceOf(address owner) public view virtual returns (uint256) {\n require(owner != address(0), \"ZERO_ADDRESS\");\n\n return _balanceOf[owner];\n }\n\n /*//////////////////////////////////////////////////////////////\n ERC721 APPROVAL STORAGE\n //////////////////////////////////////////////////////////////*/\n\n mapping(uint256 => address) public getApproved;\n\n mapping(address => mapping(address => bool)) public isApprovedForAll;\n\n /*//////////////////////////////////////////////////////////////\n CONSTRUCTOR\n //////////////////////////////////////////////////////////////*/\n\n constructor(string memory _name, string memory _symbol) {\n name = _name;\n symbol = _symbol;\n }\n\n /*//////////////////////////////////////////////////////////////\n ERC721 LOGIC\n //////////////////////////////////////////////////////////////*/\n\n function approve(address spender, uint256 id) public virtual {\n address owner = _ownerOf[id];\n\n require(msg.sender == owner || isApprovedForAll[owner][msg.sender], \"NOT_AUTHORIZED\");\n\n getApproved[id] = spender;\n\n emit Approval(owner, spender, id);\n }\n\n function setApprovalForAll(address operator, bool approved) public virtual {\n isApprovedForAll[msg.sender][operator] = approved;\n\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 id\n ) public virtual {\n require(from == _ownerOf[id], \"WRONG_FROM\");\n\n require(to != address(0), \"INVALID_RECIPIENT\");\n\n require(\n msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],\n \"NOT_AUTHORIZED\"\n );\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n unchecked {\n _balanceOf[from]--;\n\n _balanceOf[to]++;\n }\n\n _ownerOf[id] = to;\n\n delete getApproved[id];\n\n emit Transfer(from, to, id);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 id\n ) public virtual {\n transferFrom(from, to, id);\n\n if (to.code.length != 0)\n require(\n ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, \"\") ==\n ERC721TokenReceiver.onERC721Received.selector,\n \"UNSAFE_RECIPIENT\"\n );\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n bytes calldata data\n ) public virtual {\n transferFrom(from, to, id);\n\n if (to.code.length != 0)\n require(\n ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) ==\n ERC721TokenReceiver.onERC721Received.selector,\n \"UNSAFE_RECIPIENT\"\n );\n }\n\n /*//////////////////////////////////////////////////////////////\n ERC165 LOGIC\n //////////////////////////////////////////////////////////////*/\n\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return\n interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165\n interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721\n interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata\n }\n\n /*//////////////////////////////////////////////////////////////\n INTERNAL MINT/BURN LOGIC\n //////////////////////////////////////////////////////////////*/\n\n function _mint(address to, uint256 id) internal virtual {\n require(to != address(0), \"INVALID_RECIPIENT\");\n\n require(_ownerOf[id] == address(0), \"ALREADY_MINTED\");\n\n // Counter overflow is incredibly unrealistic.\n unchecked {\n _balanceOf[to]++;\n }\n\n _ownerOf[id] = to;\n\n emit Transfer(address(0), to, id);\n }\n\n function _burn(uint256 id) internal virtual {\n address owner = _ownerOf[id];\n\n require(owner != address(0), \"NOT_MINTED\");\n\n // Ownership check above ensures no underflow.\n unchecked {\n _balanceOf[owner]--;\n }\n\n delete _ownerOf[id];\n\n delete getApproved[id];\n\n emit Transfer(owner, address(0), id);\n }\n\n /*//////////////////////////////////////////////////////////////\n INTERNAL SAFE MINT LOGIC\n //////////////////////////////////////////////////////////////*/\n\n function _safeMint(address to, uint256 id) internal virtual {\n _mint(to, id);\n\n if (to.code.length != 0)\n require(\n ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, \"\") ==\n ERC721TokenReceiver.onERC721Received.selector,\n \"UNSAFE_RECIPIENT\"\n );\n }\n\n function _safeMint(\n address to,\n uint256 id,\n bytes memory data\n ) internal virtual {\n _mint(to, id);\n\n if (to.code.length != 0)\n require(\n ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) ==\n ERC721TokenReceiver.onERC721Received.selector,\n \"UNSAFE_RECIPIENT\"\n );\n }\n}\n\n/// @notice A generic interface for a contract which properly accepts ERC721 tokens.\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol)\nabstract contract ERC721TokenReceiver {\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external virtual returns (bytes4) {\n return ERC721TokenReceiver.onERC721Received.selector;\n }\n}\n" }, "src/NounishChristmasMetadata.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {Strings} from \"lib/openzeppelin-contracts/contracts/utils/Strings.sol\";\nimport {Base64} from \"base64/base64.sol\";\n\nimport {NounishERC721} from \"./base/NounishERC721.sol\";\nimport {NounishDescriptors} from \"./libraries/NounishDescriptors.sol\";\nimport {ICharacterSVGRenderer} from \"./interfaces/ICharacterSVGRenderer.sol\";\n\ncontract NounishChristmasMetadata {\n using Strings for uint256;\n\n ICharacterSVGRenderer characterRenderHelper1;\n ICharacterSVGRenderer characterRenderHelper2;\n ICharacterSVGRenderer characterRenderHelper3;\n\n constructor(\n ICharacterSVGRenderer renderHelper1,\n ICharacterSVGRenderer renderHelper2,\n ICharacterSVGRenderer renderHelper3\n ) {\n characterRenderHelper1 = renderHelper1;\n characterRenderHelper2 = renderHelper2;\n characterRenderHelper3 = renderHelper3;\n }\n\n function tokenURI(uint256 id, bytes32 gameID, NounishERC721.Info calldata info)\n external\n view\n returns (string memory)\n {\n return string(\n string.concat(\n \"data:application/json;base64,\",\n Base64.encode(\n bytes(\n abi.encodePacked(\n '{\"name\":\"' \"#\",\n id.toString(),\n \" - \",\n NounishDescriptors.tintColorName(info.tint),\n \" \",\n NounishDescriptors.characterName(info.character),\n '\", \"description\":\"',\n \"Nounish Christmas NFTs are created by playing the Nounish White Elephant game, where players can open new NFTs by minting and steal opened NFTs from others.\",\n '\", \"attributes\": ',\n attributes(gameID, info),\n ', \"image\": \"' \"data:image/svg+xml;base64,\",\n Base64.encode(bytes(svg(info))),\n '\"}'\n )\n )\n )\n )\n );\n }\n\n function svg(NounishERC721.Info calldata info) public view returns (string memory) {\n return string.concat(\n '',\n '\",\n characterSVG(info.character),\n NounishDescriptors.noggleTypeSVG(info.noggleType),\n \"\"\n );\n }\n\n function attributes(bytes32 gameID, NounishERC721.Info calldata info) public view returns (string memory) {\n return string.concat(\n \"[\",\n _traitTypeString(\"game ID\", uint256(gameID).toString()),\n \",\",\n _traitTypeString(\"character\", NounishDescriptors.characterName(info.character)),\n \",\",\n _traitTypeString(\"tint\", NounishDescriptors.tintColorName(info.tint)),\n \",\",\n _traitTypeString(\"noggle\", NounishDescriptors.noggleTypeName(info.noggleType)),\n \",\",\n _traitTypeString(\"noggle color\", NounishDescriptors.noggleColorName(info.noggleColor)),\n \",\",\n _traitTypeString(\"background color\", NounishDescriptors.backgroundColorName(info.backgroundColor)),\n \"]\"\n );\n }\n\n function characterSVG(uint8 character) public view returns (string memory) {\n if (character < 7) {\n return NounishDescriptors.characterSVG(character);\n } else if (character < 20) {\n return characterRenderHelper1.characterSVG(character);\n } else if (character < 29) {\n return characterRenderHelper2.characterSVG(character);\n } else {\n return characterRenderHelper3.characterSVG(character);\n }\n }\n\n function _traitTypeString(string memory t, string memory v) internal pure returns (string memory) {\n return string.concat(\"{\", '\"trait_type\": \"', t, '\",', '\"value\": \"', v, '\"}');\n }\n}\n" }, "src/NounishChristmasNFT.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {WhiteElephantNFT, ERC721} from \"./base/WhiteElephantNFT.sol\";\nimport {WhiteElephant} from \"./base/WhiteElephant.sol\";\n\nimport {NounishChristmasMetadata} from \"./NounishChristmasMetadata.sol\";\n\ncontract NounishChristmasNFT is WhiteElephantNFT {\n uint256 private _nonce;\n WhiteElephant public whiteElephant;\n NounishChristmasMetadata public metadata;\n\n constructor(NounishChristmasMetadata _metadata) ERC721(\"Nounish White Elephant Christmas\", \"NWEC\") {\n whiteElephant = WhiteElephant(msg.sender);\n metadata = _metadata;\n }\n\n function mint(address to) external override returns (uint256 id) {\n require(msg.sender == address(whiteElephant), \"FORBIDDEN\");\n\n _mint(to, (id = _nonce++));\n require(id < 1 << 64, \"MAX_MINT\");\n\n bytes32 h = keccak256(abi.encode(id, to, block.timestamp));\n _nftInfo[id].character = uint8(h[0]) % 32 + 1;\n _nftInfo[id].tint = uint8(h[1]) % 12 + 1;\n _nftInfo[id].backgroundColor = uint8(h[2]) % 4 + 1;\n _nftInfo[id].noggleType = uint8(h[3]) % 3 + 1;\n _nftInfo[id].noggleColor = uint8(h[4]) % 4 + 1;\n }\n\n /// @dev steal should be guarded as an owner/admin function\n function steal(address from, address to, uint256 id) external override {\n require(msg.sender == address(whiteElephant), \"FORBIDDEN\");\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n unchecked {\n _balanceOf[from]--;\n\n _balanceOf[to]++;\n }\n\n _nftInfo[id].owner = to;\n\n delete getApproved[id];\n\n emit Transfer(from, to, id);\n }\n\n function transferFrom(address from, address to, uint256 id) public override {\n require(whiteElephant.state(whiteElephant.tokenGameID(id)).gameOver, \"GAME_IN_PROGRESS\");\n super.transferFrom(from, to, id);\n }\n\n function updateMetadata(NounishChristmasMetadata _metadata) external {\n require(msg.sender == address(whiteElephant), \"FORBIDDEN\");\n\n metadata = _metadata;\n }\n\n function tokenURI(uint256 id) public view override returns (string memory) {\n return metadata.tokenURI(id, whiteElephant.tokenGameID(id), _nftInfo[id]);\n }\n\n function nftInfo(uint256 id) public view returns (Info memory) {\n return _nftInfo[id];\n }\n}\n" }, "src/base/NounishERC721.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\nimport {ERC721} from \"solmate/tokens/ERC721.sol\";\n\nabstract contract NounishERC721 is ERC721 {\n struct Info {\n uint8 character;\n uint8 tint;\n uint8 backgroundColor;\n uint8 noggleType;\n uint8 noggleColor;\n address owner;\n }\n\n mapping(uint256 => Info) public _nftInfo;\n\n function transferFrom(address from, address to, uint256 id) public virtual override {\n require(from == _nftInfo[id].owner, \"WRONG_FROM\");\n\n require(to != address(0), \"INVALID_RECIPIENT\");\n\n require(\n msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], \"NOT_AUTHORIZED\"\n );\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n unchecked {\n _balanceOf[from]--;\n\n _balanceOf[to]++;\n }\n\n _nftInfo[id].owner = to;\n\n delete getApproved[id];\n\n emit Transfer(from, to, id);\n }\n\n function approve(address spender, uint256 id) public override {\n address owner = _nftInfo[id].owner;\n\n require(msg.sender == owner || isApprovedForAll[owner][msg.sender], \"NOT_AUTHORIZED\");\n\n getApproved[id] = spender;\n\n emit Approval(owner, spender, id);\n }\n\n // function tokenURI(uint256 id) public view override returns (string memory) {\n // return \"\";\n // }\n\n function ownerOf(uint256 id) public view override returns (address owner) {\n require((owner = _nftInfo[id].owner) != address(0), \"NOT_MINTED\");\n }\n\n function _mint(address to, uint256 id) internal override {\n require(to != address(0), \"INVALID_RECIPIENT\");\n\n require(_nftInfo[id].owner == address(0), \"ALREADY_MINTED\");\n\n // Counter overflow is incredibly unrealistic.\n unchecked {\n _balanceOf[to]++;\n }\n\n _nftInfo[id].owner = to;\n\n emit Transfer(address(0), to, id);\n }\n\n function _burn(uint256 id) internal override {\n address owner = _nftInfo[id].owner;\n\n require(owner != address(0), \"NOT_MINTED\");\n\n // Ownership check above ensures no underflow.\n unchecked {\n _balanceOf[owner]--;\n }\n\n delete _nftInfo[id];\n\n delete getApproved[id];\n\n emit Transfer(owner, address(0), id);\n }\n}\n" }, "src/base/WhiteElephant.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {WhiteElephantNFT} from \"./WhiteElephantNFT.sol\";\n\ncontract WhiteElephant {\n /// @dev when game already Exists\n error GameExists();\n /// @dev when msg.sender is not `currentParticipantTurn`\n error NotTurn();\n /// @dev when tokenID was not minted in game\n error InvalidTokenIDForGame();\n /// @dev when tokenID has already been stolen twice\n error MaxSteals();\n /// @dev when tokenID was just stolen\n error JustStolen();\n /// @dev when game is over\n error GameOver();\n\n event StartGame(bytes32 indexed gameID, Game game);\n event Open(bytes32 indexed gameID, address indexed player, uint256 indexed tokenId);\n event Steal(bytes32 indexed gameID, address indexed stealer, uint256 indexed tokenId, address stolenFrom);\n\n struct Game {\n /// @dev the addresses in this game, ordered how they should have turns\n address[] participants;\n /// @dev any unique value, probably timestamp best\n uint256 nonce;\n }\n\n // used to prevent stealing back immediately\n // cannot be stollen if curRound == round\n // and trying to steal lastStolenID\n struct LastStealInfo {\n // which NFT was last stole\n uint64 lastStolenID;\n uint8 round;\n }\n\n struct GameState {\n // starts at 0\n // for whose turn, use participants[round - 1]\n uint8 round;\n bool gameOver;\n // used to track who goes next after a steal\n address nextToGo;\n LastStealInfo lastStealInfo;\n }\n\n WhiteElephantNFT public nft;\n\n /// @notice how many times has a tokenID been stolen\n mapping(uint256 => uint256) public timesStolen;\n /// @notice what game a given tokenID was minted in\n mapping(uint256 => bytes32) public tokenGameID;\n mapping(bytes32 => GameState) internal _state;\n\n /// @notice starts a game\n /// @dev does not check participant addresses, address(0) or other incorrect\n /// address could render game unable to progress\n /// @dev reverts if `game` exists\n /// @param game Game specification, {participants: address[], nonce: uint256}\n /// @return _gameID the unique identifier for the game\n function startGame(Game calldata game) public payable virtual returns (bytes32 _gameID) {\n _gameID = gameID(game);\n\n if (_state[_gameID].round != 0) {\n revert GameExists();\n }\n\n _state[_gameID].round = 1;\n\n emit StartGame(_gameID, game);\n }\n\n /// @notice open a new gift\n /// @param game the game the participant caller is in and wishes to open in\n /// game = {participants: address[], nonce: uint256}\n function open(Game calldata game) public virtual {\n bytes32 _gameID = gameID(game);\n\n _checkGameOver(_gameID);\n\n _checkTurn(_gameID, game);\n\n uint8 newRoundCount = _state[_gameID].round + 1;\n _state[_gameID].round = newRoundCount;\n if (newRoundCount > game.participants.length) {\n _state[_gameID].gameOver = true;\n }\n\n _state[_gameID].nextToGo = address(0);\n\n uint256 tokenID = nft.mint(msg.sender);\n tokenGameID[tokenID] = _gameID;\n\n emit Open(_gameID, msg.sender, tokenID);\n }\n\n /// @notice Steals NFT from another participant\n /// @dev reverts if tokenID not minted in `game`\n /// @dev reverts if token has been stolen twice already\n /// @dev reverts if tokenID was just stolen\n /// @param game the game the participant is in and wishes to steal in\n /// game = {participants: address[], nonce: uint256}\n /// @param tokenID that token they wish to steal, must have been minted by another participant in same game\n function steal(Game calldata game, uint256 tokenID) public virtual {\n bytes32 _gameID = gameID(game);\n\n _checkGameOver(_gameID);\n\n _checkTurn(_gameID, game);\n\n if (_gameID != tokenGameID[tokenID]) {\n revert InvalidTokenIDForGame();\n }\n\n if (timesStolen[tokenID] == 2) {\n revert MaxSteals();\n }\n\n uint8 currentRound = _state[_gameID].round;\n if (_state[_gameID].round == _state[_gameID].lastStealInfo.round) {\n if (_state[_gameID].lastStealInfo.lastStolenID == tokenID) {\n revert JustStolen();\n }\n }\n\n timesStolen[tokenID] += 1;\n _state[_gameID].lastStealInfo = LastStealInfo({lastStolenID: uint64(tokenID), round: currentRound});\n\n address currentOwner = nft.ownerOf(tokenID);\n _state[_gameID].nextToGo = currentOwner;\n\n nft.steal(currentOwner, msg.sender, tokenID);\n\n emit Steal(_gameID, msg.sender, tokenID, currentOwner);\n }\n\n /// @notice returns the state of the given game ID\n /// @param _gameID the game identifier, from gameID(game)\n /// @return state the state of the game\n /// struct GameState {\n /// uint8 round;\n /// bool gameOver;\n /// address nextToGo;\n /// LastStealInfo lastStealInfo;\n /// }\n /// struct LastStealInfo {\n /// uint64 lastStolenID;\n /// uint8 round;\n /// }\n function state(bytes32 _gameID) public view virtual returns (GameState memory) {\n return _state[_gameID];\n }\n\n /// @notice returns which address can call open or steal next in a given game\n /// @param _gameID the id of the game\n /// @param game the game\n /// game = {participants: address[], nonce: uint256}\n /// @return participant the address that is up to go next\n function currentParticipantTurn(bytes32 _gameID, Game calldata game) public view virtual returns (address) {\n if (_state[_gameID].gameOver) {\n return address(0);\n }\n \n address next = _state[_gameID].nextToGo;\n if (next != address(0)) return next;\n\n return game.participants[_state[_gameID].round - 1];\n }\n\n /// @notice returns the unique identifier for a given game\n /// @param game, {participants: address[], nonce: uint256}\n /// @return gameID the id of the game\n function gameID(Game calldata game) public pure virtual returns (bytes32) {\n return keccak256(abi.encode(game));\n }\n\n function _checkTurn(bytes32 _gameID, Game calldata game) internal view {\n if (currentParticipantTurn(_gameID, game) != msg.sender) {\n revert NotTurn();\n }\n }\n\n function _checkGameOver(bytes32 _gameID) internal view {\n if (_state[_gameID].gameOver) {\n revert GameOver();\n }\n }\n}\n" }, "src/base/WhiteElephantNFT.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {NounishERC721, ERC721} from \"./NounishERC721.sol\";\n\nabstract contract WhiteElephantNFT is NounishERC721 {\n /// @dev mint should be guarded as an owner/admin function\n function mint(address to) external virtual returns (uint256);\n /// @dev steal should be guarded as an owner/admin function\n function steal(address from, address to, uint256 id) external virtual;\n}\n" }, "src/interfaces/ICharacterSVGRenderer.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\ninterface ICharacterSVGRenderer {\n function characterSVG(uint8 character) external pure returns (string memory);\n}\n" }, "src/libraries/NoggleSVGs.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\nlibrary NoggleSVGs {\n function basic() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '' '';\n }\n\n function cool() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function large() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '' ''\n '' '';\n }\n}\n" }, "src/libraries/NounishDescriptors.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\nimport {NoggleSVGs} from \"./NoggleSVGs.sol\";\nimport {OneThroughSixCharacterSVGs} from \"./OneThroughSixCharacterSVGs.sol\";\n\nlibrary NounishDescriptors {\n function characterName(uint8 character) internal pure returns (string memory) {\n if (character == 1) {\n return \"Cardinal\";\n } else if (character == 2) {\n return \"Swan\";\n } else if (character == 3) {\n return \"Blockhead\";\n } else if (character == 4) {\n return \"Dad\";\n } else if (character == 5) {\n return \"Trout Sniffer\";\n } else if (character == 6) {\n return \"Elf\";\n } else if (character == 7) {\n return \"Mothertrucker\";\n } else if (character == 8) {\n return \"Girl\";\n } else if (character == 9) {\n return \"Lamp\";\n } else if (character == 10) {\n return \"Mean One\";\n } else if (character == 11) {\n return \"Miner\";\n } else if (character == 12) {\n return \"Mrs. Claus\";\n } else if (character == 13) {\n return \"Noggleman\";\n } else if (character == 14) {\n return \"Noggle Tree\";\n } else if (character == 15) {\n return \"Nutcracker\";\n } else if (character == 16) {\n return \"Partridge in a Pear Tree\";\n } else if (character == 17) {\n return \"Rat King\";\n } else if (character == 18) {\n return \"Reindeer S\";\n } else if (character == 19) {\n return \"Reindeer Pro Max\";\n } else if (character == 20) {\n return \"Santa S\";\n } else if (character == 21) {\n return \"Santa Max Pro\";\n } else if (character == 22) {\n return \"Skeleton\";\n } else if (character == 23) {\n return \"Chunky Snowman\";\n } else if (character == 24) {\n return \"Slender Snowman\";\n } else if (character == 25) {\n return \"Snowman Pro Max\";\n } else if (character == 26) {\n return \"Sugar Plum Fairy\";\n } else if (character == 27) {\n return \"Short Thief\";\n } else if (character == 28) {\n return \"Tall Thief\";\n } else if (character == 29) {\n return \"Train\";\n } else if (character == 30) {\n return \"Christmas Tree\";\n } else if (character == 31) {\n return \"Yeti S\";\n } else if (character == 32) {\n return \"Yeti Pro Max\";\n }\n return \"\";\n }\n\n /// @dev wanted to make the most of contract space, only renders through character 6\n function characterSVG(uint8 character) internal pure returns (string memory) {\n if (character == 1) {\n return OneThroughSixCharacterSVGs.cardinal();\n } else if (character == 2) {\n return OneThroughSixCharacterSVGs.swan();\n } else if (character == 3) {\n return OneThroughSixCharacterSVGs.blockhead();\n } else if (character == 4) {\n return OneThroughSixCharacterSVGs.dad();\n } else if (character == 5) {\n return OneThroughSixCharacterSVGs.troutSniffer();\n } else if (character == 6) {\n return OneThroughSixCharacterSVGs.elf();\n }\n return \"\";\n }\n\n function noggleTypeName(uint8 noggleType) internal pure returns (string memory) {\n if (noggleType == 1) {\n return \"Noggles S\";\n } else if (noggleType == 2) {\n return \"Cool Noggles\";\n } else if (noggleType == 3) {\n return \"Noggles Pro Max\";\n }\n return \"\";\n }\n\n function noggleTypeSVG(uint8 noggleType) internal pure returns (string memory) {\n if (noggleType == 1) {\n return NoggleSVGs.basic();\n } else if (noggleType == 2) {\n return NoggleSVGs.cool();\n } else if (noggleType == 3) {\n return NoggleSVGs.large();\n }\n return \"\";\n }\n\n function noggleColorName(uint8 noggleColor) internal pure returns (string memory) {\n if (noggleColor == 1) {\n return \"Dark Plum\";\n } else if (noggleColor == 2) {\n return \"Warm Red\";\n } else if (noggleColor == 3) {\n return \"Peppermint\";\n } else if (noggleColor == 4) {\n return \"Cold Blue\";\n } else if (noggleColor == 5) {\n return \"Ring-a-Ding\";\n }\n return \"\";\n }\n\n function noggleColorHex(uint8 noggleColor) internal pure returns (string memory) {\n if (noggleColor == 1) {\n return \"513340\";\n } else if (noggleColor == 2) {\n return \"bd2d24\";\n } else if (noggleColor == 3) {\n return \"4ab49a\";\n } else if (noggleColor == 4) {\n return \"0827f5\";\n } else if (noggleColor == 5) {\n return \"f0c14d\";\n }\n return \"\";\n }\n\n function backgroundColorName(uint8 background) internal pure returns (string memory) {\n if (background == 1) {\n return \"Douglas Fir\";\n } else if (background == 2) {\n return \"Night\";\n } else if (background == 3) {\n return \"Rooftop\";\n } else if (background == 4) {\n return \"Mistletoe\";\n } else if (background == 5) {\n return \"Spice\";\n }\n return \"\";\n }\n\n function backgroundColorHex(uint8 background) internal pure returns (string memory) {\n if (background == 1) {\n return \"3e5d25\";\n } else if (background == 2) {\n return \"100d98\";\n } else if (background == 3) {\n return \"403037\";\n } else if (background == 4) {\n return \"326849\";\n } else if (background == 5) {\n return \"651d19\";\n }\n return \"\";\n }\n\n function tintColorName(uint8 tint) internal pure returns (string memory) {\n if (tint == 1) {\n return \"Boot Black\";\n } else if (tint == 2) {\n return \"Fairydust\";\n } else if (tint == 3) {\n return \"Elf\";\n } else if (tint == 4) {\n return \"Plum\";\n } else if (tint == 5) {\n return \"Explorer\";\n } else if (tint == 6) {\n return \"Hot Cocoa\";\n } else if (tint == 7) {\n return \"Carrot\";\n } else if (tint == 8) {\n return \"Spruce\";\n } else if (tint == 9) {\n return \"Holly\";\n } else if (tint == 10) {\n return \"Sleigh\";\n } else if (tint == 11) {\n return \"Jolly\";\n } else if (tint == 12) {\n return \"Coal\";\n } else if (tint == 13) {\n return \"Snow White\";\n }\n return \"\";\n }\n\n function tintColorHex(uint8 tint) internal pure returns (string memory) {\n if (tint == 1) {\n return \"000000\";\n } else if (tint == 2) {\n return \"2a46ff\";\n } else if (tint == 3) {\n return \"f38b7c\";\n } else if (tint == 4) {\n return \"7c3c58\";\n } else if (tint == 5) {\n return \"16786c\";\n } else if (tint == 6) {\n return \"36262d\";\n } else if (tint == 7) {\n return \"cb7300\";\n } else if (tint == 8) {\n return \"06534a\";\n } else if (tint == 9) {\n return \"369f49\";\n } else if (tint == 10) {\n return \"ff0e0e\";\n } else if (tint == 11) {\n return \"fd5442\";\n } else if (tint == 12) {\n return \"453f41\";\n } else if (tint == 13) {\n return \"ffffff\";\n }\n return \"\";\n }\n}\n" }, "src/libraries/OneThroughSixCharacterSVGs.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\nlibrary OneThroughSixCharacterSVGs {\n function cardinal() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function swan() internal pure returns (string memory) {\n return ''\n '' ''\n '' ''\n ''\n ''\n '' ''\n ''\n ''\n ''\n '' ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function blockhead() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function dad() internal pure returns (string memory) {\n return 'return '\n ''\n ''\n ''\n ''\n '' ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function troutSniffer() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n\n function elf() internal pure returns (string memory) {\n return ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '' ''\n '' ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n ''\n '';\n }\n}\n" } }, "settings": { "remappings": [ "base64/=lib/base64/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} } }