Standard for musicians pioneered by Catalog & Mint Songs.
- 73 Music NFT attributes stored on chain in your music nft metadata.
- WARNING: these contracts are unaudited
- Your Music NFT Smart Contract (ERC721).
- Your Music NFT in OpenSea
- Works out of the box.
- 100% free CC0 technology (MIT License - use this w/o crediting me).
To add music NFT metadata to your next music NFT drop, just
npm i onchain-music-metadata
import "onchain-music-metadata/contracts/OnChainMusicMetadata.sol";
contract MyMusic is OnChainMusicMetadata
- use the
musicTokenUri(tokenId)
method freely.
// 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);
}
}
Checkout our Github for the latest changes.