use miden::standards::faucets::fungible->faucet

#! BURN script: burns the asset from the note by calling the faucet's `receive_and_burn`
#! procedure. This note is intended to be executed against a fungible faucet account.
#!
#! The receive_and_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:
#! - `miden::standards::faucets::fungible::receive_and_burn` procedure.
#!
#! Inputs:  [ARGS, pad(12)]
#! Outputs: [pad(16)]
#!
#! Panics if:
#! - account does not expose receive_and_burn procedure.
#! - any of the validations in the receive_and_burn procedure fail.
@note_script
pub proc main
    dropw
    # => [pad(16)]

    # Call the fungible faucet receive_and_burn wrapper which enforces burn policy and then burns
    # the asset.
    call.faucet::receive_and_burn
    # => [pad(16)]
end
