create_burn_note

Function create_burn_note 

Source
pub fn create_burn_note<R: FeltRng>(
    sender: AccountId,
    faucet_id: AccountId,
    fungible_asset: Asset,
    aux: Felt,
    rng: &mut R,
) -> Result<Note, NoteError>
Expand description

Generates a BURN note - a note that instructs a faucet to burn a fungible asset.

This script enables the creation of a PUBLIC note that, when consumed by a faucet (either basic or network), will burn the fungible assets contained in the note. Both basic and network fungible faucets export the same burn procedure with identical MAST roots, allowing a single BURN note script to work with either faucet type.

BURN notes are always PUBLIC for network execution.

The passed-in rng is used to generate a serial number for the note. The note’s tag is automatically set to the faucet’s account ID for proper routing.

§Parameters

  • sender: The account ID of the note creator
  • faucet_id: The account ID of the faucet that will burn the assets
  • fungible_asset: The fungible asset to be burned
  • aux: Auxiliary data for the note
  • rng: Random number generator for creating the serial number

§Errors

Returns an error if note creation fails.