zellic-audit
Initial commit
f998fcd
raw
history blame
17.2 kB
{
"language": "Solidity",
"sources": {
"lib/moonbirds-contract/contracts/IMoonbirds.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >=0.8.10 <0.9.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\";\n\n/**\n@dev A minimal interface for interaction with the Moonbirds contract.\n */\ninterface IMoonbirds is IERC721 {\n function nestingPeriod(uint256 tokenId)\n external\n view\n returns (\n bool nesting,\n uint256 current,\n uint256 total\n );\n}\n"
},
"lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../token/ERC721/IERC721.sol\";\n"
},
"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"
},
"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"src/eligibility/ERC1155Holder.sol": {
"content": "// SPDX-License-Identifier: MIT\n// Copyright 2022 PROOF Holdings Inc\npragma solidity >=0.8.16 <0.9.0;\n\nimport {IEligibilityConstraint} from \"./IEligibilityConstraint.sol\";\nimport {IMoonbirds} from \"moonbirds/IMoonbirds.sol\";\nimport {IERC1155} from \"openzeppelin-contracts/token/ERC1155/IERC1155.sol\";\nimport {Nested} from \"./Nested.sol\";\n\n/**\n * @notice Eligibility if the moonbird owner holds a token from another ERC721\n * collection.\n */\ncontract SpecificERC1155Holder is IEligibilityConstraint {\n /**\n * @notice The moonbird token.\n */\n IMoonbirds private immutable _moonbirds;\n\n /**\n * @notice The collection of interest.\n */\n IERC1155 private immutable _token;\n\n /**\n * @notice The ERC1155 token-type (i.e. id) of interest within the\n * collection.\n */\n uint256 private immutable _id;\n\n constructor(IMoonbirds moonbirds_, IERC1155 token_, uint256 id_) {\n _moonbirds = moonbirds_;\n _token = token_;\n _id = id_;\n }\n\n /**\n * @dev Returns true iff the moonbird holder also owns a token from a\n * pre-defined collection.\n */\n function isEligible(uint256 tokenId) public view virtual returns (bool) {\n return _token.balanceOf(_moonbirds.ownerOf(tokenId), _id) > 0;\n }\n}\n\ncontract NestedSpecificERC1155Holder is Nested, SpecificERC1155Holder {\n constructor(IMoonbirds moonbirds_, IERC1155 token_, uint256 id_)\n Nested(moonbirds_)\n SpecificERC1155Holder(moonbirds_, token_, id_)\n {} //solhint-disable-line no-empty-blocks\n\n /**\n * @dev Returns true iff the moonbird is nested and its holder also owns a\n * token from a pre-defined collection.\n */\n function isEligible(uint256 tokenId)\n public\n view\n virtual\n override(Nested, SpecificERC1155Holder)\n returns (bool)\n {\n return Nested.isEligible(tokenId)\n && SpecificERC1155Holder.isEligible(tokenId);\n }\n}\n"
},
"src/eligibility/IEligibilityConstraint.sol": {
"content": "// SPDX-License-Identifier: MIT\n// Copyright 2022 PROOF Holdings Inc\npragma solidity >=0.8.16 <0.9.0;\n\n/**\n * @notice Interface to encapsulate generic eligibility requirements.\n * @dev This is intended to be used with the activation of Mutators.\n */\ninterface IEligibilityConstraint {\n /**\n * @notice Checks if a given moonbird is eligible.\n */\n function isEligible(uint256 tokenId) external view returns (bool);\n}\n"
},
"src/eligibility/Nested.sol": {
"content": "// SPDX-License-Identifier: MIT\n// Copyright 2022 PROOF Holdings Inc\npragma solidity >=0.8.16 <0.9.0;\n\nimport {IEligibilityConstraint} from \"./IEligibilityConstraint.sol\";\nimport {IMoonbirds} from \"moonbirds/IMoonbirds.sol\";\n\n/**\n * @notice Eligibility if a moonbird is nested.\n */\ncontract Nested is IEligibilityConstraint {\n /**\n * @notice The moonbird token.\n */\n IMoonbirds private immutable _moonbirds;\n\n constructor(IMoonbirds moonbirds_) {\n _moonbirds = moonbirds_;\n }\n\n /**\n * @dev Returns true iff the moonbird is nested.\n */\n function isEligible(uint256 tokenId) public view virtual returns (bool) {\n (bool nesting,,) = _moonbirds.nestingPeriod(tokenId);\n return nesting;\n }\n}\n\n/**\n * @notice Eligibility if a moonbird is nested since a given time.\n */\ncontract NestedSince is IEligibilityConstraint {\n /**\n * @notice The moonbird token.\n */\n IMoonbirds private immutable _moonbirds;\n\n /**\n * @notice A moonbird has to be nested since this timestamp to be eligible.\n */\n uint256 private immutable _sinceTimestamp;\n\n constructor(IMoonbirds moonbirds_, uint256 sinceTimestamp_) {\n _moonbirds = moonbirds_;\n _sinceTimestamp = sinceTimestamp_;\n }\n\n /**\n * @dev Returns true iff the moonbird is nested since a given time.\n */\n function isEligible(uint256 tokenId) public view virtual returns (bool) {\n (bool nested, uint256 current,) = _moonbirds.nestingPeriod(tokenId);\n //solhint-disable-next-line not-rely-on-time\n return nested && block.timestamp - current <= _sinceTimestamp;\n }\n}\n"
}
},
"settings": {
"remappings": [
"@divergencetech/ethier/=lib/ethier_0_27_0/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ERC721A/=lib/ERC721A/contracts/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/solidify/lib/openzeppelin-contracts/lib/erc4626-tests/",
"erc721a/=lib/ERC721A/",
"ethier/=lib/ethier/contracts/",
"ethier_0_27_0/=lib/ethier_0_27_0/",
"forge-std/=lib/forge-std/src/",
"inflate-sol/=lib/inflate-sol/contracts/",
"moonbirds-contract/=lib/moonbirds-contract/",
"moonbirds-inchain/=src/",
"moonbirds/=lib/moonbirds-contract/contracts/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"solidify-contracts/=lib/solidify/contracts/",
"solidify-test/=lib/solidify/./test/",
"solidify/=lib/solidify/"
],
"optimizer": {
"enabled": true,
"runs": 99999
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {
"lib/solidify/contracts/InflateLibWrapper.sol": {
"PublicInflateLibWrapper": "0x8d69408205dEc1F1Eb5A2250C8638017Ef6069b6"
}
}
}
}