Payment split
License payments send 80% to the recorded creator and 20% to the configured treasury. In atomic units:1_000_001 splits into 800_001 for the creator and 200_000 for the treasury.
Token configuration
Read the Royalties config PDA derived from['royalties'] under the Royalties program ID. Its account layout contains the treasury and token mint. The verified devnet mint uses six decimals and the classic SPL Token Program.
All payment token accounts must use that mint. The payer signs for its token account, the creator token account belongs to the original creator, and the treasury token account belongs to the configured treasury.
Instruction 1: distribute payment
The data layout is:
Accounts, in order: payer (writable signer), payer token account (writable), creator token account (writable), treasury token account (writable), Royalties config (readonly), SPL Token Program (readonly).
This instruction transfers the split directly from the payer’s token account. It does not create a license record. Remix supplies the original’s price and creator when purchasing rights.
A zero amount returns without a token transfer. A wrong mint, treasury recipient or supplied creator rejects a priced transfer. The program logs
LicensePaymentDistributed with the song ID, amount and both shares.
Other instructions
These configuration operations use the program’s existing authority. Your product reads the selected deployment’s configuration before constructing payment accounts.
Royalties program source · Deployed programs