Skip to main content
Call Remix to purchase a license or register a variation. A license purchase consumes one available license. A later variation mint uses those rights without another license payment.

Connect and purchase

Use publicClient, 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:
An existing buyer keeps their rights without another charge. For a new buyer, check availability, read the actual settlement token and approve Remix for the listed price:
After any required approval succeeds, purchase the license and confirm the rights:
A zero-price license skips approval. Display the token and price to the buyer before signing; read them again if the operation is delayed. Store each submitted hash so your product can recover confirmation after a reload.

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:
The signer must hold a license for a remixable original. Remaining allocation may be zero if that signer already owns rights. Use the Factory receipt example to obtain 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