Sound Protocol is a generalized platform for flexible and efficient creation of NFT drops.
SoundCreatorV1 Factory contract
| Network | Address |
|---|---|
Mainnet |
0xaef3e8c8723d9c31863be8de54df2668ef7c4b89 |
Goerli |
0xaef3e8c8723d9c31863be8de54df2668ef7c4b89 |
Optimism |
0x5bcf5773bcf1f131a0cad5c74aa9be1a80b63c55 |
Permissionless zero-fee minter/metadata deployments on Mainnet, Goerli, Optimism, and Optimism Goerli:
| Contract | Address |
|---|---|
GoldenEggMetadata |
0x000000002154ad3431c330ac2db6ed42195f9141 |
OpenGoldenEggMetadata |
0x00000000c417a48cd096067520747607a0331f0e |
MerkleDropMinter |
0x0000000067149f4d5e7d2904179b8fccca000539 |
RangeEditionMinter |
0x000000006154a95522e183f4d85bb7f2cd666ae8 |
See spec for current protocol specification. For details on how to build and run a custom minter instance, see section "Adding a custom minter module" section in spec. Documentation coming soon.
The Sound Protocol comprises of several components:
-
SoundEditionThe NFT contract.
An ERC721A contract deployed via the minimal proxy clone pattern.
The
mintfunction allows authorized minter contracts or administrators to batch mint NFTs
(authorization is granted via theMINTER_ROLEorADMIN_ROLE). -
SoundCreatorA factory that allows for a single transaction setup that:
- Deploys and initializes
SoundEdition. - Authorize one or more
MinterContracts onSoundEdition. - Configure one or more
MinterContracts to mint onSoundEdition.
- Deploys and initializes
-
MinterContractA contract to call the
mintfunction onSoundEdition.
This contract can implement any kind of customized sales logic.
One or moreMinterContracts can be used on theSoundEditionsimultaneously. -
fundingRecipientCan be a contract such as a 0xSplits wallet, or an Externally Owned Account (EOA).
-
MetadataContractA contract which is called by the
SoundEditionin thetokenURIfunction for customizable metadata logic.
Optional.
flowchart LR
SoundCreatorV1 --> initialize
subgraph SoundEditionV1
initialize
mint
withdrawETH
withdrawERC20
tokenURI
end
tokenURI -.-> MetadataContract
A[Minter A] --> mint
B[Minter B] --> mint
C[Minter C] --> mint
withdrawETH --> fundingRecipient
withdrawERC20 --> fundingRecipient
The smart contracts are stored under the contracts directory.
Files marked with an asterisk (*) are specific to sound.xyz,
but you can refer to them if you are building contracts to interact with them on-chain,
or building your own customized versions.
contracts/
├── core
│ ├── SoundCreatorV1.sol ─ "Factory"
│ ├── SoundEditionV1.sol ─ "NFT implementation"
│ ├── SoundFeeRegistry.sol * ─ "Platform fee registry"
│ ├── interfaces
│ │ ├── IMetadataModule.sol ─ "Metadata module interface"
│ │ ├── IMinterModule.sol ─ "Generalized minter interface"
│ │ ├── ISoundCreatorV1.sol ─ "Factory interface"
│ │ ├── ISoundEditionV1.sol ─ "NFT implementation interface"
│ │ └── ISoundFeeRegistry.sol * ─ "Platform fee registry interface"
│ └── utils
│ └── ArweaveURILib.sol * ─ "For efficient storage of Arweave URIs"
└── modules
├── BaseMinter.sol * ─ "Shared minting logic"
├── EditionMaxMinter.sol * ─ "Minimalistic minter"
├── FixedPriceSignatureMinter.sol * ─ "For permissioned mints via ECDSA signatures"
├── MerkleDropMinter.sol * ─ "For permissioned mints via Merkle proofs"
├── RangeEditionMinter.sol * ─ "Cuts off mints after a set time if a quota is hit"
├── GoldenEggMetadata.sol * ─ "For the on-chain golden egg metadata"
└── interfaces
├── IEditionMaxMinter.sol *
├── IFixedPriceSignatureMinter.sol *
├── IMerkleDropMinter.sol *
├── IRangeEditionMinter.sol *
└── IGoldenEggMetadata.sol *A comprehensive documentation is currently in the works.
Please refer to the Natspec comments and spec for now for further details.
- git
- nodeJS
- node version manager
- pnpm - You need to have
pnpminstalled globally, you can runnpm i -g pnpmto install it. - brew
- foundry - You can run
sh ./setup.shto install Foundry and its dependencies.
-
Clone the repository
git clone git@github.com:soundxyz/sound-protocol.git cd sound-protocol -
Setup node version Either install the version specified in
nvmrcor usenvmto set it up:nvm use -
Install packages
pnpm install -
Build contracts
pnpm build -
Run tests
pnpm test -
Print gas reports from tests
pnpm test:gas
(v == logs verbosity)
forge test -vvv
Code coverage:
We use codecov for analysing the code coverage reports generated by forge coverage. To view code coverage locally, you'll need to install lcov (mac: brew install lcov) and run:
pnpm test:coverage
This will produce the coverage report in /coverage folder. Note that forge coverage is still in active development so it often claims if/else branches are uncovered even when there are tests executed on them.
Create a .env in the root with:
GOERLI_RPC_URL=
MAINNET_RPC_URL=
PRIVATE_KEY=
ETHERSCAN_KEY=
OWNER=<address that will own the ownable contracts>
Then run:
pnpm deploy:goerli
Up to 10 ETH for any critical bugs that could result in loss of funds. Rewards will be given for smaller bugs or ideas.
MIT Copyright 2022 Sound.xyz