Fees

Defines:

public struct Royalties has key {
        id: UID,
        app: address,
        custom_coin_type: TypeName,
        partner_fee: u64,
        partner_treasury: address,
        protocol_fee: u64,
        protocol_treasury: address
}

Collect Payment

The collect_payment function has these effects:

  1. Transfers custom & sui payments to the Sage treasury

Create Royalties

The create_royalties function has these effects:

  1. Asserts the fee settings are within range

  2. Creates Royalties for the App

  3. Adds the Royalties to the App

  4. Shares the Royalties configuration

  5. Returns the Royalties address

Distribute Payment

The distribute_payment function has these effects:

  1. Splits the custom payment depending upon the Royalties config

  2. Sends payments to all relevant parties

Updates Royalties

The collect_payment function has these effects:

  1. Asserts the fee settings are within range

  2. Updates the Royalties config

Last updated