onchain-music-metadata
v1.0.15
Published
NFT music metadata. Stored on-chain as Base64 encoded string. Works with OpenSea, Zora, Catalog, and all other music NFT Protocols.
Downloads
48
Maintainers
Readme
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.
- WARNING: these contracts are unaudited
You Newest Tool for Music NFTs (100% on chain)
- 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).
Get Started
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.
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.