ProtoSound is a web3 platform where musicians can upload their songs minting a Soulbound Tokens (song + cover) for their profile.
This action will also generate a collection of NFTs song covers generated by the artist that will be randomly assigned to the buyers when they purchase a song.
Install dependencies.
yarn install
Compile contracts
yarn hardhat compile
Run local hardhat node
yarn hardhat node
Add your account private keys and token URIs opening .env
or creating one
HARDHAT_ACCOUNT1='...'
HARDHAT_ACCOUNT2='...'
HARDHAT_ACCOUNT3='...'
# For running tests
AUDIO_URI='https://...'
IMAGE_URI1='https://...'
IMAGE_URI2='https://...'
IMAGE_URI3='https://...'
# For testing on Polygon Mumbai
MATIC_ACCOUNT1='...'
MATIC_ACCOUNT2='...'
MATIC_ACCOUNT3='...'
# defines the network to use during deployment
# 'matic' | 'hardhat'
NET='...'
Run tests, by default runs in local hardhat node
yarn hardhat test
Optionally you can run them in Polygon Mumbai
⚠️ It might take several minutes to run all the tests.
yarn hardhat test --network matic
Deploy contracts to default network (local hardhat)
yarn hardhat run scripts/deploy.ts
Or deploy to Polygon Mumbai
yarn hardhat run scripts/deploy.ts --network matic
The ProtoSound
contract allows users to create songs setting a price and minting 3 types of tokens, an AuthorSongCover
Soulbound token, an AuthorSongAudio
Soulbound token, and a collection of SongCover
NFT tokens.
When another user wants to buy and consume a song, after paying the price, one of the mentioned SongCover
tokens are randomly selected from the collection and transferred to the buyer. Aquiring a new NFT token plus the song itself.