onchain-music-metadata

1.0.15 • Public • Published

Music NFT OnChain Metadata

Standard for musicians pioneered by Catalog & Mint Songs.

  • 73 unique 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.

Package Sidebar

Install

npm i onchain-music-metadata

Weekly Downloads

17

Version

1.0.15

License

MIT

Unpacked Size

23.3 kB

Total Files

8

Last publish

Collaborators

  • sweetman.eth