Skip to content

SweetmanTech/Onchain-Music-Metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music NFT OnChain Metadata

Standard for musicians pioneered by Catalog & Mint Songs.

  • 73 Music NFT attributes stored on chain in your music nft metadata.

Screen Shot 2022-07-30 at 8 59 39 PM

- WARNING: these contracts are unaudited

You Newest Tool for Music NFTs (100% on chain)

Screen Shot 2022-07-30 at 9 00 55 PM

Get Started

To add music NFT metadata to your next music NFT drop, just

  1. npm i onchain-music-metadata
  2. import "onchain-music-metadata/contracts/OnChainMusicMetadata.sol";
  3. contract MyMusic is OnChainMusicMetadata
  4. use the musicTokenUri(tokenId) method freely.

Example Music NFT:

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.15;

import "onchain-music-metadata/contracts/Example/ExampleToken.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract MusicNFT is ERC721, ExampleToken {
    uint256 songId;

    constructor() ERC721("music nft", "mnft") {
        songId = 0;
        setupSongMetadata();
        setupProjectMetadata();
    }

    function mint() public {
        songId++;
        _mint(msg.sender, songId);
    }

    function tokenURI(uint256 _tokenId)
        public
        view
        virtual
        override(ERC721)
        returns (string memory)
    {
        require(_exists(_tokenId), "tokenId doesn't exist");
        return musicTokenUri(_tokenId);
    }
}

Credits:

More info

Checkout our Github for the latest changes.

About

On-Chain Music Metadata for music NFTs. NPM package with `npm i onchain-music-metadata`.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published