Skip to content

bangtoven/CryptoComposer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Composer on Polygon

  • Mint NFTs storing music data
  • Ensure originality and uniqueness by checking hash
  • Play back the songs registered on blockchain

User workflows

  • Sign in with Ethereum provider
  • Browe songs and see metadata (title, composer account)
  • Play songs
  • Buy CCT(CryptoComposerToken) to pay for minting new songs
  • Write a new song and mint it as NFT
  • (Access them on NFT marketplaces like OpenSea. e.g. Song #0 on Crypto Composer

Architecture and directory structure

Smart contracts

Bootstraped with Truffle, and deployed on Polygon, Ropsten, and Rinkeby (deployed_address.txt)

- contracts
 - CryptoComposer.sol   - deployed. checks payment and call minter
 - CryptoNFTMinter.sol  - inherited by CryptoComposer. manages minting
 - CryptoComposerToken.sol       - ERC20 token to use CryptoComposer.
 - CryptoComposerTokenVendor.sol - manages price and minting of CCT.
- migrations
- tests

Frontend

React app built with next.js accessible at https://crypto-composer.bangtoven.com/

Referenced Reactronica to build DAWStepsEditor

- pages
- components
- hooks
- styles
- public

Instructions

Install and migration

# install frontend dependencies, smart contract tooling, and solidity libraries
yarn install

# deploy smart contracts to local network
ganache-cli -p 8545 # or Ganache GUI
truffle migrate

You need these local contract addresses of CryptoComposerTokenVendor and CryptoComposer later to update frontend.

Deploy to public network: Create and fill .secret and .infura_api_key files, then run truffle migrate --network {NETWORK}

Run unit tests

ganache-cli -p 8545 # or Ganache GUI
truffle test

Run frontend locally

Update contract addresses for 1337 network on hooks/useContract.js with addresses from the previous step.

// hooks/useContract.js
...
export function useCryptoComposerContract() {
...
      [1337, `{CryptoComposer_address}`],
...

export function useCCTVendorContract() {
...
      [1337, `{CryptoComposerTokenVendor_address}`],
...
yarn build && yarn start

Use the deployed web app

Set your local network id to 1337 and open https://crypto-composer.bangtoven.com/

Ethereum account for certificatation NFT

jungho.eth
0xB8E1aCe6Aa298777552eda47B71857201D662134

License

Copyright © 2022, Jungho Bang. Released under the MIT License.