{"id":15634770,"url":"https://github.com/vectorized/closedsea","last_synced_at":"2025-07-04T16:07:21.100Z","repository":{"id":63057701,"uuid":"564900647","full_name":"Vectorized/closedsea","owner":"Vectorized","description":"Optimized and flexible version of OpenSea's operator filterer","archived":false,"fork":false,"pushed_at":"2023-07-30T06:09:17.000Z","size":260,"stargazers_count":131,"open_issues_count":3,"forks_count":27,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-14T19:10:38.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vectorized.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-11T19:15:36.000Z","updated_at":"2025-05-27T14:03:18.000Z","dependencies_parsed_at":"2024-06-18T22:39:30.647Z","dependency_job_id":"0258a342-6dc7-4bf1-906a-2f416d9fd8a3","html_url":"https://github.com/Vectorized/closedsea","commit_stats":{"total_commits":55,"total_committers":4,"mean_commits":13.75,"dds":"0.054545454545454564","last_synced_commit":"f980e958076835fadd5259c3c86eb3c6f50bb33d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vectorized/closedsea","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectorized%2Fclosedsea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectorized%2Fclosedsea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectorized%2Fclosedsea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectorized%2Fclosedsea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vectorized","download_url":"https://codeload.github.com/Vectorized/closedsea/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectorized%2Fclosedsea/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260318652,"owners_count":22991116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T10:56:54.115Z","updated_at":"2025-07-04T16:07:21.076Z","avatar_url":"https://github.com/Vectorized.png","language":"Solidity","readme":"# ClosedSea 🚪\n\n[![NPM][npm-shield]][npm-url]\n[![CI][ci-shield]][ci-url]\n[![MIT License][license-shield]][license-url]\n\n\u003e **📢 The OpenSea deadline for newly published contracts to include operator filtering has been extended to 2nd Jan 2023.**   \n\u003e\n\u003e **However, there is a new requirement that all contracts published from then onwards MUST include the ERC2981 royalty standard.**  \n\u003e\n\u003e **Please refer to the examples, updated for your convenience.**\n\n## About the Project\n\nGas optimized and flexible version of OpenSea's Mandatory Operator Filterer for royalties.\n\n## Features\n\n- Modifiers can be toggled on / off efficiently.\n\n- Gas optimized. Saves 300+ gas on transfers.\n\n- Keeps your clients and some marketplaces happy.\n\n## Installation\n\nTo install with [**Foundry**](https://github.com/gakonst/foundry):\n\n```sh\nforge install vectorized/closedsea\n```\n\nTo install with [**Hardhat**](https://github.com/nomiclabs/hardhat) or [**Truffle**](https://github.com/trufflesuite/truffle):\n\n```sh\nnpm install closedsea\n```\n\n## Contracts\n\n```ml\nsrc\n├─ OperatorFilterer.sol — \"Operator Filterer for regular and upgradeable contracts\"\n└─ example\n   ├─ ExampleERC721A.sol — \"ERC721A example\"\n   ├─ ExampleERC721.sol — \"ERC721 example\"\n   ├─ ExampleERC1155.sol — \"ERC1155 example\"\n   └─ upgradeable\n      ├─ ExampleERC721AUpgradeable.sol — \"ERC721A upgradeable example\"\n      ├─ ExampleERC721Upgradeable.sol — \"ERC721 upgradeable example\"\n      └─ ExampleERC1155Upgradeable.sol — \"ERC1155 upgradeable example\"\n``` \n\n## Examples\n\n| Type | Contract |\n|---|---|\n| ERC721A | [`src/example/ExampleERC721A.sol`](./src/example/ExampleERC721A.sol) |\n| ERC721 | [`src/example/ExampleERC721.sol`](./src/example/ExampleERC721.sol) |\n| ERC1155 | [`src/example/ExampleERC1155.sol`](./src/example/ExampleERC1155.sol) |\n| ERC721AUpgradeable | [`src/example/upgradeable/ExampleERC721AUpgradeable.sol`](./src/example/upgradeable/ExampleERC721AUpgradeable.sol) |\n| ERC721Upgradeable | [`src/example/upgradeable/ExampleERC721Upgradeable.sol`](./src/example/upgradeable/ExampleERC721Upgradeable.sol) |\n| ERC1155Upgradeable | [`src/example/upgradeable/ExampleERC1155Upgradeable.sol`](./src/example/upgradeable/ExampleERC1155Upgradeable.sol) |\n\n## API\n\n### `_registerForOperatorFiltering`\n```solidity \nfunction _registerForOperatorFiltering(\n    address subscriptionOrRegistrantToCopy, \n    bool subscribe\n) internal virtual\n````\nRegistration function that can be called in an initializer, anywhere.  \n\nCan be called repeatedly without issues.\n\nTo subscribe to the [default OpenSea curated block list](https://github.com/ProjectOpenSea/operator-filter-registry/#deployments), simply use `_registerForOperatorFiltering()`, without arguments.\n\n### `onlyAllowedOperator`\n```solidity\nmodifier onlyAllowedOperator(address from) virtual\n```  \nModifier to guard a function and revert if `from` is a blocked operator.  \n\n### `onlyAllowedOperatorApproval`\n```solidity\nmodifier onlyAllowedOperatorApproval(address operator) virtual\n```  \nModifier to guard a function from approving a blocked operator.  \n\n### `_operatorFilteringEnabled`\n```solidity\nfunction _operatorFilteringEnabled() internal view virtual returns (bool)\n```  \nFor deriving contracts to override, so that operator filtering can be turned on / off.\n\nReturns true by default.\n\n### `_isPriorityOperator`\n```solidity\nfunction _isPriorityOperator(address operator) internal view virtual returns (bool)\n```  \nFor deriving contracts to override, so that preferred marketplaces can skip operator filtering, helping users save gas.\n\nReturns false for all inputs by default.\n\n## Safety\n\nWe have verified with OpenSea engineers that ClosedSea is fully compatible with their royalties enforcement system, as of Nov 18th 2022.\n\nNevertheless, this codebase is provided on an \"as is\" and \"as available\" basis.\n\nWe **do not give any warranties** and **will not be liable for any loss** incurred through any use of this codebase.\n\n## Acknowledgements\n\nThis repository is inspired by and directly modified from:\n\n- [operator-filter-registry](https://github.com/ProjectOpenSea/operator-filter-registry)\n\n[npm-shield]: https://img.shields.io/npm/v/closedsea.svg\n[npm-url]: https://www.npmjs.com/package/closedsea\n\n[ci-shield]: https://img.shields.io/github/actions/workflow/status/vectorized/closedsea/ci.yml?label=build\u0026branch=main\n[ci-url]: https://github.com/vectorized/closedsea/actions/workflows/ci.yml\n\n[license-shield]: https://img.shields.io/badge/License-MIT-green.svg\n[license-url]: https://github.com/vectorized/closedsea/blob/main/LICENSE.txt\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorized%2Fclosedsea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectorized%2Fclosedsea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorized%2Fclosedsea/lists"}