Skip to content

1kresh/closedsea

 
 

Repository files navigation

ClosedSea 🚪

NPM CI MIT License

Gas optimized and flexible version of OpenSea's Mandatory Operator Filterer for royalties.

Features

  • modifier onlyAllowedOperator(address from, bool filterEnabled)
    modifier that allows conditional toggling of the filter.

    You can passed in a bool extracted from a packed variable for filterEnabled.

  • _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe)

    Registration function that can be called in an initializer, anywhere.

    Can be called repeatedly without issues.

  • _registerForOperatorFiltering()

    Registration function similar to above. Uses OpenSea's default block list.

  • Gas optimized. Saves 300+ gas on transfers.

  • Keeps your cilents and some marketplaces happy.

Example

See src/example/ExampleERC721.sol.

Contracts

src
├─ OperatorFilterer.sol — "Operator Filterer for regular and upgradeable contracts"
└─ example
   ├─ ExampleERC1155.sol — "ERC1155 example"
   ├─ ExampleERC721.sol — "ERC721 example with demonstration of togglability"
   └─ upgradeable
      ├─ ExampleERC1155Upgradeable.sol — "ERC1155 upgradeable example"
      └─ ExampleERC721Upgradeable.sol — "ERC721 upgradeable example"

Safety

This is experimental software and is provided on an "as is" and "as available" basis.

We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.

Installation

To install with Foundry:

forge install vectorized/closedsea

To install with Hardhat or Truffle:

npm install closedsea

Acknowledgements

This repository is inspired by and directly modified from:

About

Optimized and flexible version of OpenSea's operator filterer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Solidity 98.4%
  • JavaScript 1.6%