Skip to content
ProjectOpenSeaPublic

About

Smart contracts for primary drops on EVM chains

Resources

Stars

315 stars

Watchers

9 watching

Forks

Repository files navigation

SeaDrop_GithubCover

Version Test CI Code Coverage License Docs Discussions

SeaDrop

SeaDrop is a contract for conducting primary NFT drops on evm-compatible blockchains.

Table of Contents

Background

SeaDrop is a contract to perform primary drops on evm-compatible blockchains. The types of drops supported are public drops, allow list stages, token gated drops, and server-side signed mints. An implementing token contract should contain the methods to interface with SeaDrop through an authorized user such as an Owner or Administrator.

Future SeaDrop contracts are envisioned to contain additional functionality like descending dutch auction mechanisms and payment in ERC20 tokens.

Deployments

SeaDrop 1.0 is deployed at 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5 on Ethereum and most other networks OpenSea supports. On OpenSea, SeaDrop v1 from this branch powers drops. SeaDrop v2, on the v2 branch, currently powers ERC-1155 open collections, which the collection owner mints.

See Deployments for the clone factories, every network, and the legacy contracts. To deploy to a new network, follow SeaDrop Deployment.

Diagram

SeaDrop Diagram

This diagram shows the logic flow in the case that a drop is hosted on OpenSea, with an optional mint hosted elsewhere. Note that a fee recipient is not required to integrate with SeaDrop, and a fee recipient may be any address.

Docs

Install

SeaDrop builds and tests with Foundry. To install Foundry (Linux or macOS):

curl -L https://foundry.paradigm.xyz | bash
foundryup

To clone the repo with its dependencies and compile the contracts:

git clone --recurse-submodules https://github.com/ProjectOpenSea/seadrop && cd seadrop
forge build

Node.js (see .nvmrc) is only needed for the formatting and git hook tooling. npm install installs Biome and sets up the lefthook pre-commit hook, which runs forge fmt and Biome on staged files.

npm install

Usage

To run the tests:

forge test

This runs the upgradeable contracts' tests too. src/upgradeable compiles with its deployable settings (via-IR, 1000 optimizer runs) in the same build; see Upgradeable Contracts.

To run coverage:

npm run coverage

To run a gas snapshot:

forge snapshot

Add -vv through -vvvvv to forge test for logs, traces for failing tests, and setup traces. See the Foundry Book for more.

To run lint checks (forge fmt --check, forge lint, and Biome):

npm run lint

To fix formatting:

npm run lint:fix

Audits

SeaDrop was audited after development by Spearbit, read the report here.

Contributing

Contributions to SeaDrop are welcome by anyone interested in writing more tests, improving readability, optimizing for gas efficiency, or extending the protocol with new features.

When making a pull request, ensure that:

  • All tests pass.
  • Code coverage remains at 100%.
  • All new code adheres to the style guide:
    • All lint checks pass.
    • Code is thoroughly commented with natspec where relevant.
  • If making a change to the contracts:
    • Gas snapshots are provided and demonstrate an improvement (or an acceptable deficit given other improvements).
    • Reference contracts are modified correspondingly if relevant.
    • New Foundry tests are included for all new features or code paths.
  • A descriptive summary of the PR has been provided.

License

MIT Copyright 2022 Ozone Networks, Inc.

About

Smart contracts for primary drops on EVM chains

Resources

Stars

315 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages