Connect and purchase
UsepublicClient, walletClient, account and evmContracts from Contracts stack. Check the original’s creator and metadata URI against the song you selected, using Factory’s song read.
Read existing rights before requesting payment. The example below uses an existing originalSongId and the verified original’s state returned by getSong:
Mint a variation
RemixParams contains licenseAmount, licensePrice and streamPrice, all uint256. Variations are always marked remixable = false, even if allocation fields are nonzero. The example uses zero allocation and license price, the verified original ID and your variation’s final metadataUri:
mintedId. Confirm SongRemixed, then read the new song: its creator must be the signer, its URI must match, isRemix must be true and parentSongId must equal originalSongId.
Public interface
LicensePurchased(originalSongId, licensee, price) identifies a new purchase. SongRemixed(originalSongId, remixedSongId, remixer, metadataUri) identifies a variation. Both IDs and the remixer are indexed in SongRemixed.
A missing license reverts with LicenseRequired. An absent song, unavailable allocation or non-remixable original rejects the corresponding call. A failed purchase rolls back both its payment and license state.
License workflow · Remix interface