Skip to content

A permissionless, open-source, modular smart contract framework for efficient creation of digital collectibles by musicians, artists, and creators.

License

Notifications You must be signed in to change notification settings

soundxyz/sound-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sound Protocol

Specification

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.

Deployments

Installation

Prerequisites

Setup

  • Clone the repository
git clone git@github.com:soundxyz/sound-protocol.git
cd sound-protocol
  • Setup node version Either install the version specified in nvmrc or use nvm to 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

Code conventions

We generally follow OpenZeppelin's conventions:

  • Underscore _before private variables.
  • Underscore after_ function arguments which shadow globals.
  • Natspec format for comments, using @dev for function descriptions.

To run prettier on all solidity files, uncomment the last line in .prettierrc.js, then run npx prettier --write ./contracts/**/*.sol

Testing

To see logs when testing (v == 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.

Deployment

Create a .env in the root with:

PRIVATE_KEY=...
ETHERSCAN_KEY=...
# Make one of these for every network
GOERLI_RPC_URL=...

Then run:

pnpm deploy:goerli

According to the foundry docs, we should be able to verify on etherscan by appending this to the above command: --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv, but that doesn't seem to work. Instead, we can verify each contract individually. Ex:

forge verify-contract --chain-id 5 --num-of-optimizations 200 --compiler-version v0.8.15 0x4613283c53669847c40eb0cf7946f1fb30b1f030 contracts/modules/Metadata/GoldenEggMetadataModule.sol:GoldenEggMetadataModule

About

A permissionless, open-source, modular smart contract framework for efficient creation of digital collectibles by musicians, artists, and creators.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages