feat: Replace get_balance and has_non_fungible_asset with get_asset#2369
Merged
PhilippGackstatter merged 63 commits intonextfrom Feb 3, 2026
Merged
feat: Replace get_balance and has_non_fungible_asset with get_asset#2369PhilippGackstatter merged 63 commits intonextfrom
get_balance and has_non_fungible_asset with get_asset#2369PhilippGackstatter merged 63 commits intonextfrom
Conversation
…t-kernel-procedures
…t-kernel-procedures
mmagician
approved these changes
Jan 30, 2026
crates/miden-protocol/asm/kernels/transaction/lib/asset_vault.masm
Outdated
Show resolved
Hide resolved
crates/miden-protocol/asm/kernels/transaction/lib/asset_vault.masm
Outdated
Show resolved
Hide resolved
Co-authored-by: Marti <marti@miden.team>
…slot' into pgackst-asset-kernel-procedures
Co-authored-by: Marti <marti@miden.team>
Farukest
added a commit
to Farukest/miden-base
that referenced
this pull request
Feb 4, 2026
Resolve merge conflicts with recent changes: - 0xMiden#2369: Updated offset numbers for new get_asset API - 0xMiden#2377: Keep pub const prefix for all offset constants
afa7789
pushed a commit
to afa7789/miden-base
that referenced
this pull request
Mar 9, 2026
…set` (0xMiden#2369) * feat: include total supply logic in faucet logic * chore: replace get_fungible_asset_max_amount with constant * chore: Add `token_supply` to `BasicFungibleFaucet` * chore: remove total_issuance update from `faucet::burn` * feat: implement token_supply update in basic fungible faucet `burn` * fix: faucet tests * chore: remove total_issuance update from `faucet::mint_fungible_asset` * chore: update network fungible faucet and deduplicate code * chore: remove issuance tracking logic for non-fungible assets * chore: remove sysdata checks in prologue * chore: remove sysdata access procedures in miden::protocol * chore: replace usages of `FungibleFaucetExt` * chore: Remove `AccountStorage::faucet_sysdata_slot` * chore: remove invalid faucet sysdata slot tests * chore: remove sysdata accessor procedure tests * fix: agglayer and faucet tests * chore: assert origin in burn_non_fungible_asset * chore: remove initial_balance from mock_fungible_faucet * fix: agglayer faucet metadata word layout * chore: update `create_basic_fungible_faucet` docs * chore: remove reserved slot check from `account::set_item` * chore: remove `get_total_issuance` and `is_non_fungible_asset_issued` * chore: remove `FAUCET_SYSDATA_SLOT` from account.masm * chore: remove `AccountType` param from `AccountStorage::from_components` * chore: update mentiones of "reserved slot" * chore: add test checking ERR_FAUCET_BURN_AMOUNT_EXCEEDS_TOKEN_SUPPLY * chore: update faucets::distribute docs * fix: remove impossible error condition * chore: update burn note root * chore: add changelog * fix: p2id script root * Apply suggestions from code review Co-authored-by: Marti <marti@miden.team> * chore: simplify faucets::burn * chore: better describe assertions * chore: improve max/token supply docs on fungible faucets * fix: update BURN_NOTE_ROOT * chore: allow public constants in kernel proc offsets * feat: Replace get_balance kernel proc with get_asset * chore: rename event before_get_balance to before_get_asset * feat: refactor get_asset to take an ASSET_KEY * feat: remove account::has_non_fungible_asset * chore: update P2ID and BURN note roots * chore: test get_asset and get_initial_asset * chore: add changelog * feat: refactor `peek_balance` into `peek_asset` * chore: make docs consistent * Update crates/miden-agglayer/src/lib.rs Co-authored-by: Marti <marti@miden.team> * chore: add docs for when peeking is useful * Apply suggestions from code review Co-authored-by: Marti <marti@miden.team> --------- Co-authored-by: Marti <marti@miden.team> Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for expanding assets from one to two words, this PR:
get_balance,get_initial_balanceandhas_non_fungible_assetkernel procedures.get_assetandget_initial_assetkernel procedures.asset_vault::peek_balanceintoasset_vault::peek_asset.Note that the corresponding procedures in
miden::protocol::active_accountare retained until it becomes clear how built in fungible assetes should be handled. So, the user-facing behavior is preserved. These now build on top of the more generalget_(initial_)assetprocedures.This PR simplifies the kernel-internal restructuring of assets from one to two words, and since we'll need a general
get_assetanyway, this makes sense to do first.part of #2328