Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
40e538c
Refactor code structure for improved readability and maintainability
afa7789 Feb 26, 2026
728e145
fix: fixing after rebase.
afa7789 Feb 26, 2026
d0eae16
refactor: improve formatting and readability in various files
afa7789 Feb 26, 2026
146d102
Refactor metadata handling in fungible faucets
afa7789 Feb 26, 2026
1735931
refactor: update token metadata references in faucet tests to use Fun…
afa7789 Feb 28, 2026
0f7766c
chore: lint
afa7789 Feb 28, 2026
6fd309e
Refactor token metadata encoding to use 7-bytes-per-felt, length-pref…
afa7789 Mar 4, 2026
8eb4949
refactor: replace RPO256 with Poseidon2 for hashing in fungible metad…
afa7789 Mar 4, 2026
441accb
refactor: format BasicFungibleFaucet initialization for improved read…
afa7789 Mar 4, 2026
02c6af1
fix: adapt metadata MASM to little-endian word ordering after upstrea…
afa7789 Mar 4, 2026
9a9a4dc
chore: adding type as entry instead of separate variables
afa7789 Mar 5, 2026
e750a75
refactor: enforce defining supported types on metadata (#2554)
igamigo Mar 5, 2026
af62bc4
feat: enforce maximum serialized size for output notes (#2205)
Forostovec Mar 6, 2026
8fa4ab0
feat: introduce `AccountIdKey` (#2495)
swaploard Mar 6, 2026
af78cb0
fix: make format and remove unused import (#2564)
PhilippGackstatter Mar 6, 2026
25c65a5
feat: make `NoteMetadataHeader` public (#2561)
SantiagoPittella Mar 6, 2026
527695f
chore: ProvenBlock constructor with validation (#2553)
sergerad Mar 6, 2026
daebbbc
refactor: include fee in TransactionId computation
bobbinth Mar 6, 2026
cbfdd1c
refactor: remove `Ord` and `PartialOrd` from `StorageSlot` (#2549)
PercyDikec Mar 6, 2026
330f939
chore: Replace SMT leaf conversion function (#2271)
sergerad Mar 6, 2026
a7ae72b
feat: add ability to submit user batches for the MockChain (#2565)
igamigo Mar 6, 2026
1105a93
chore: Explicitly use `get_native_account_active_storage_slots_ptr` i…
bobbinth Mar 7, 2026
e04970b
chore: fix typos
bobbinth Mar 7, 2026
33440ac
feat: integrate PSM contracts to AuthMultisig (#2527)
onurinanc Mar 9, 2026
ac4637c
chore: remove `ProvenTransactionBuilder` in favor of `ProvenTransacti…
Himess Mar 9, 2026
0adc24b
feat: implement `Ownable2Step` (#2292)
afa7789 Mar 9, 2026
cf79614
feat: add token metadata support to NetworkFungibleFaucet
afa7789 Mar 9, 2026
68cc2fe
feat: enforce maximum serialized size for output notes (#2205)
Forostovec Mar 6, 2026
90cf256
feat: implement `Ownable2Step` (#2292)
afa7789 Mar 9, 2026
88c69d4
feat: prefix account components with miden::standards namespace (#2400)
Himess Mar 9, 2026
b9016c5
Refactor code structure for improved readability and maintainability
afa7789 Feb 26, 2026
7567315
Refactor metadata handling in fungible faucets
afa7789 Feb 26, 2026
0816ec8
refactor: update token metadata references in faucet tests to use Fun…
afa7789 Feb 28, 2026
0a969d5
chore: adding type as entry instead of separate variables
afa7789 Mar 5, 2026
2fdc772
feat: add owner support to TokenMetadata and update related components
afa7789 Mar 9, 2026
7b8aa54
fix: correct output order in get_owner function
afa7789 Mar 9, 2026
644f66b
feat: enhance ownership handling in fungible faucets and metadata com…
afa7789 Mar 9, 2026
1dff206
fix: update documentation for metadata_slot and description commitmen…
afa7789 Mar 9, 2026
a67dfd8
Merge remote-tracking branch 'upstream/next' into oz/metadata_extension
afa7789 Mar 9, 2026
c96e746
Merge branch 'next' into oz/metadata_extension
PhilippGackstatter Mar 11, 2026
b7a6146
Update crates/miden-standards/asm/standards/access/ownable.masm
afa7789 Mar 11, 2026
ed67de5
Merge remote-tracking branch 'upstream/next' into oz/metadata_extension
afa7789 Mar 11, 2026
c891bf9
refactor: improve comments and assertions in distribute function for …
afa7789 Mar 11, 2026
1b86098
Refactor fungible metadata procedures: rename optional setters to sta…
afa7789 Mar 11, 2026
8f7c3f8
refactor: standardize TokenMetadata usage across faucets and tests
afa7789 Mar 11, 2026
bd71231
chore: Refactor code structure for improved readability and maintaina…
afa7789 Mar 11, 2026
b341396
feat: add TokenMetadata and AccountSchemaCommitment components for en…
afa7789 Mar 11, 2026
ff473ea
chore: lint
afa7789 Mar 11, 2026
11d775f
Merge branch 'next' into oz/metadata_extension
afa7789 Mar 11, 2026
9b73740
refactor: replace TokenName::new("") with TokenName::default() for co…
afa7789 Mar 11, 2026
746c15b
refactor: update metadata field limits and improve code consistency
afa7789 Mar 11, 2026
e949534
chore: lint
afa7789 Mar 11, 2026
2b0cf83
remove duplicates!
afa7789 Mar 12, 2026
547b1a8
refactor: remove unused scale_down_amount procedure
afa7789 Mar 12, 2026
2e5221f
Merge remote-tracking branch 'upstream/next' into oz/metadata_extension
afa7789 Mar 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- Made `NoteMetadataHeader` and `NoteMetadata::to_header()` public, added `NoteMetadata::from_header()` constructor, and exported `NoteMetadataHeader` from the `note` module ([#2561](https://github.com/0xMiden/protocol/pull/2561)).
- Introduce NOTE_MAX_SIZE (32 KiB) and enforce it on individual output notes ([#2205](https://github.com/0xMiden/miden-base/pull/2205))
- Added AggLayer faucet registry to bridge account with conversion metadata, `CONFIG_AGG_BRIDGE` note for faucet registration, and FPI-based asset conversion in `bridge_out` ([#2426](https://github.com/0xMiden/miden-base/pull/2426)).
- Added metadata extension (`Info`) with name and content URI slots, and MASM procedures `get_token_metadata`, `get_max_supply`, `get_decimals`, and `get_token_symbol` for the token metadata standard. Aligned fungible faucet token metadata with the metadata standard: faucet now uses the canonical slot `miden::standards::metadata::token_metadata` so MASM metadata getters work with faucet storage.([#2439](https://github.com/0xMiden/miden-base/pull/2439))

- Enable `CodeBuilder` to add advice map entries to compiled scripts ([#2275](https://github.com/0xMiden/miden-base/pull/2275)).
- Added `BlockNumber::MAX` constant to represent the maximum block number ([#2324](https://github.com/0xMiden/miden-base/pull/2324)).
- Added single-word `Array` standard ([#2203](https://github.com/0xMiden/miden-base/pull/2203)).
Expand Down Expand Up @@ -45,6 +47,9 @@
- [BREAKING] The native hash function changed from RPO256 to Poseidon2 - see PR description ([#2508](https://github.com/0xMiden/miden-base/pull/2508)).
- Introduced `StorageMapKey` and `StorageMapKeyHash` Word wrappers for type-safe storage map key handling ([#2431](https://github.com/0xMiden/miden-base/pull/2431)).
- Restructured `miden-agglayer/asm` directory to separate bridge and faucet into per-component libraries, preventing cross-component procedure exposure ([#2294](https://github.com/0xMiden/miden-base/issues/2294)).
- `TokenMetadata` (faucet) now uses the shared metadata slot from the metadata module for consistency with MASM standards.
- Prefixed standard account component names with `miden::standards::components` ([#2400](https://github.com/0xMiden/miden-base/pull/2400)).
- `TokenMetadata` (faucet) now uses the shared metadata slot from the metadata module for consistency with MASM standards.
- Prefixed standard account component names with `miden::standards::components` ([#2400](https://github.com/0xMiden/miden-base/pull/2400)).
- Made kernel procedure offset constants public and replaced accessor procedures with direct constant usage ([#2375](https://github.com/0xMiden/miden-base/pull/2375)).
- [BREAKING] Made `AccountComponentMetadata` a required parameter of `AccountComponent::new()`; removed `with_supported_type`, `with_supports_all_types`, and `with_metadata` methods from `AccountComponent`; simplified `AccountComponentMetadata::new()` to take just `name`; renamed `AccountComponentTemplateError` to `ComponentMetadataError` ([#2373](https://github.com/0xMiden/miden-base/pull/2373), [#2395](https://github.com/0xMiden/miden-base/pull/2395)).
Expand Down
6 changes: 0 additions & 6 deletions crates/miden-agglayer/asm/agglayer/faucet/mod.masm
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ proc get_raw_claim_amount
mem_load.OUTPUT_NOTE_ASSET_AMOUNT_MEM_ADDR_0
end

# Inputs: [U256[0], U256[1]]
# Outputs: [amount]
proc scale_down_amount
repeat.7 drop end
end

# Inputs: [PROOF_DATA_KEY, LEAF_DATA_KEY]
# Outputs: []
proc batch_pipe_double_words
Expand Down
25 changes: 18 additions & 7 deletions crates/miden-agglayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use miden_protocol::asset::TokenSymbol;
use miden_protocol::block::account_tree::AccountIdKey;
use miden_protocol::note::NoteScript;
use miden_standards::account::auth::NoAuth;
use miden_standards::account::faucets::{FungibleFaucetError, TokenMetadata};
use miden_standards::account::faucets::{FungibleFaucetError, FungibleTokenMetadata, TokenName};
use miden_utils_sync::LazyLock;

pub mod b2agg_note;
Expand Down Expand Up @@ -313,14 +313,14 @@ static CONVERSION_INFO_2_SLOT_NAME: LazyLock<StorageSlotName> = LazyLock::new(||
///
/// ## Storage Layout
///
/// - [`Self::metadata_slot`]: Stores [`TokenMetadata`].
/// - [`Self::metadata_slot`]: Stores [`FungibleTokenMetadata`].
/// - [`Self::bridge_account_id_slot`]: Stores the AggLayer bridge account ID.
/// - [`Self::conversion_info_1_slot`]: Stores the first 4 felts of the origin token address.
/// - [`Self::conversion_info_2_slot`]: Stores the remaining 5th felt of the origin token address +
/// origin network + scale.
#[derive(Debug, Clone)]
pub struct AggLayerFaucet {
metadata: TokenMetadata,
metadata: FungibleTokenMetadata,
bridge_account_id: AccountId,
origin_token_address: EthAddressFormat,
origin_network: u32,
Expand All @@ -332,7 +332,7 @@ impl AggLayerFaucet {
///
/// # Errors
/// Returns an error if:
/// - The decimals parameter exceeds maximum value of [`TokenMetadata::MAX_DECIMALS`].
/// - The decimals parameter exceeds maximum value of [`FungibleTokenMetadata::MAX_DECIMALS`].
/// - The max supply exceeds maximum possible amount for a fungible asset.
/// - The token supply exceeds the max supply.
pub fn new(
Expand All @@ -345,7 +345,18 @@ impl AggLayerFaucet {
origin_network: u32,
scale: u8,
) -> Result<Self, FungibleFaucetError> {
let metadata = TokenMetadata::with_supply(symbol, decimals, max_supply, token_supply)?;
// Use empty name for agglayer faucets (name is stored in Info component, not here).
let name = TokenName::default();
let metadata = FungibleTokenMetadata::with_supply(
symbol,
decimals,
max_supply,
token_supply,
name,
None,
None,
None,
)?;
Ok(Self {
metadata,
bridge_account_id,
Expand All @@ -364,9 +375,9 @@ impl AggLayerFaucet {
Ok(self)
}

/// Storage slot name for [`TokenMetadata`].
/// Storage slot name for [`FungibleTokenMetadata`].
pub fn metadata_slot() -> &'static StorageSlotName {
TokenMetadata::metadata_slot()
FungibleTokenMetadata::metadata_slot()
}

/// Storage slot name for the AggLayer bridge account ID.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# The MASM code of the Basic Fungible Faucet Account Component.
#
# See the `BasicFungibleFaucet` Rust type's documentation for more details.
# This component depends on `FungibleTokenMetadata` being present in the account.

pub use ::miden::standards::faucets::basic_fungible::distribute
pub use ::miden::standards::faucets::basic_fungible::burn
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The MASM code of the Fungible Token Metadata Account Component.
#
# Re-exported from module miden::standards::components::fungible_token_metadata
# All metadata-related procedures are re-exported here.

pub use ::miden::standards::metadata::fungible::get_name
pub use ::miden::standards::metadata::fungible::get_mutability_config
pub use ::miden::standards::metadata::fungible::is_max_supply_mutable
pub use ::miden::standards::metadata::fungible::is_description_mutable
pub use ::miden::standards::metadata::fungible::is_logo_uri_mutable
pub use ::miden::standards::metadata::fungible::is_external_link_mutable
pub use ::miden::standards::metadata::fungible::get_token_metadata
pub use ::miden::standards::metadata::fungible::get_max_supply
pub use ::miden::standards::metadata::fungible::get_decimals
pub use ::miden::standards::metadata::fungible::get_token_symbol
pub use ::miden::standards::metadata::fungible::get_token_supply
pub use ::miden::standards::metadata::fungible::set_description
pub use ::miden::standards::metadata::fungible::set_logo_uri
pub use ::miden::standards::metadata::fungible::set_external_link
pub use ::miden::standards::metadata::fungible::set_max_supply
pub use ::miden::standards::metadata::fungible::get_owner
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# The MASM code of the Network Fungible Faucet Account Component.
#
# See the `NetworkFungibleFaucet` Rust type's documentation for more details.
# This component depends on `FungibleTokenMetadata` being present in the account.

pub use ::miden::standards::faucets::network_fungible::distribute
pub use ::miden::standards::faucets::network_fungible::burn
4 changes: 4 additions & 0 deletions crates/miden-standards/asm/standards/access/ownable.masm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ end
#! Invocation: call
pub proc get_owner
exec.owner
# => [owner_suffix, owner_prefix, pad(16)]

# truncate stack to 16
movup.2 drop movup.2 drop
# => [owner_suffix, owner_prefix, pad(14)]
end

Expand Down
7 changes: 3 additions & 4 deletions crates/miden-standards/asm/standards/faucets/mod.masm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use ::miden::protocol::asset::FUNGIBLE_ASSET_MAX_AMOUNT
const ASSET_PTR=0
const PRIVATE_NOTE=2


# ERRORS
# =================================================================================================

Expand All @@ -31,9 +32,9 @@ const ERR_BASIC_FUNGIBLE_BURN_WRONG_NUMBER_OF_ASSETS="burn requires exactly 1 no
# The local memory address at which the metadata slot content is stored.
const METADATA_SLOT_LOCAL=0

# The standard slot where fungible faucet metadata like token symbol or decimals are stored.
# The standard slot where fungible faucet metadata is stored (canonical with metadata module).
# Layout: [token_supply, max_supply, decimals, token_symbol]
const METADATA_SLOT=word("miden::standards::fungible_faucets::metadata")
const METADATA_SLOT=word("miden::standards::metadata::token_metadata")

#! Distributes freshly minted fungible assets to the provided recipient by creating a note.
#!
Expand Down Expand Up @@ -68,8 +69,6 @@ pub proc distribute
swap movup.2 drop movup.2 drop
# => [max_supply, token_supply, amount, tag, note_type, RECIPIENT]

# Assert that minting does not violate any supply constraints.
#
# To make sure we cannot mint more than intended, we need to check:
# 1) (max_supply - token_supply) <= max_supply, i.e. the subtraction does not wrap around
# 2) amount + token_supply does not exceed max_supply
Expand Down
Loading
Loading