miden-lib 0.12.4

Standard library of the Miden protocol
Documentation
use.miden::contracts::faucets

#! BURN script: burns the asset from the note by calling the faucet's burn procedure.
#! This note can be executed against any faucet account that exposes the faucets::burn procedure
#! (e.g., basic fungible faucet or network fungible faucet).
#!
#! The burn procedure in the faucet already handles all necessary validations including:
#! - Checking that the note contains exactly one asset
#! - Verifying the asset is a fungible asset issued by this faucet
#! - Ensuring the amount to burn doesn't exceed the outstanding supply
#!
#! Requires that the account exposes:
#! - burn procedure (from the faucets interface).
#!
#! Inputs:  [ARGS, pad(12)]
#! Outputs: [pad(16)]
#!
#! Panics if:
#! - account does not expose burn procedure.
#! - any of the validations in the burn procedure fail.
begin
    dropw
    # => [pad(16)]

    # Call the faucet's burn procedure which handles all validations
    call.faucets::burn
    # => [pad(16)]
end