Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0d0bab2
add burn policies
onurinanc Mar 23, 2026
5f83f68
changelog
onurinanc Mar 23, 2026
dd98e91
merge next
onurinanc Mar 26, 2026
384d1a0
fix comments
onurinanc Mar 26, 2026
c372e8c
refactor OwnerControlled and AuthControlled
onurinanc Mar 26, 2026
75b2bd9
Merge branch 'next' into burn-policies
onurinanc Mar 30, 2026
191004a
Merge branch 'next' into burn-policies
onurinanc Apr 2, 2026
993f49f
review fix
onurinanc Apr 2, 2026
da85160
move slots to a shared location
onurinanc Apr 2, 2026
a2f20cd
Merge remote-tracking branch 'origin/burn-policies' into burn-policies
onurinanc Apr 2, 2026
ce9da75
Merge branch 'next' into burn-policies
bobbinth Apr 19, 2026
8339173
remove OwnerControlled
onurinanc Apr 20, 2026
c8655be
add owner only burn for agglayer faucet
onurinanc Apr 20, 2026
c6866c8
Merge remote-tracking branch 'upstream/next' into burn-policies
onurinanc Apr 20, 2026
1507b4c
Merge remote-tracking branch 'origin/burn-policies' into burn-policies
onurinanc Apr 20, 2026
aa212f9
use native_word remove FeltSchema
onurinanc Apr 21, 2026
13beb08
Merge branch 'next' into burn-policies
onurinanc Apr 21, 2026
eb545e9
merge upstream/next
onurinanc Apr 22, 2026
906dded
merge next
onurinanc Apr 22, 2026
fe329f7
Merge remote-tracking branch 'origin/burn-policies' into burn-policies
onurinanc Apr 22, 2026
89ed9d5
fix
onurinanc Apr 22, 2026
00c3ec9
extract mint and burn policies
onurinanc Apr 23, 2026
8edc3f5
merge next
onurinanc Apr 23, 2026
9b64e45
refactor extraction
onurinanc Apr 23, 2026
d572c6d
simplify masm and rust
onurinanc Apr 23, 2026
259604d
refactor masm
onurinanc Apr 23, 2026
d79d94c
deduplication using policy trait
onurinanc Apr 23, 2026
9f4e2b5
changelog
onurinanc Apr 23, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
- [BREAKING] Changed `native_account::remove_asset` to return the asset value remaining in the vault instead of the removed value ([#2626](https://github.com/0xMiden/protocol/pull/2626)).
- Implemented `TransactionEventId::event_name` and `Host::resolve_event` for better VM diagnostics during even handler failures ([#2628](https://github.com/0xMiden/protocol/pull/2628)).
- Added `FixedWidthString` for fixed-width UTF-8 string storage in `miden-standards` (`miden::standards::utils::string`). ([#2633](https://github.com/0xMiden/protocol/pull/2633))
- [BREAKING] Changed mint and burn policy management into standalone generic `PolicyManager<Mint|Burn>` components under `account::policies::{mint,burn}` ([#2821](https://github.com/0xMiden/protocol/pull/2821)).


### Changes

Expand Down
16 changes: 12 additions & 4 deletions crates/miden-agglayer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ use miden_protocol::account::{
};
use miden_protocol::transaction::TransactionKernel;
use miden_standards::account::auth::NoAuth;
use miden_standards::account::burn_policies::BurnOwnerControlled;
use miden_standards::account::mint_policies::MintOwnerControlled;
use miden_standards::account::policies::burn::owner_controlled::Config as BurnConfig;
use miden_standards::account::policies::mint::owner_controlled::Config as MintConfig;
use miden_standards::account::policies::{burn, mint};

// CONSTANTS
// ================================================================================================
Expand Down Expand Up @@ -256,8 +257,15 @@ fn generate_agglayer_constants(
components.push(AccountComponent::from(
miden_standards::account::access::Ownable2Step::new(dummy_owner),
));
components.push(AccountComponent::from(MintOwnerControlled::owner_only()));
components.push(AccountComponent::from(BurnOwnerControlled::allow_all()));
// Mirror the component order used by `create_agglayer_faucet_builder` in lib.rs so
// the compile-time code commitment matches the one computed at runtime.
components.push(mint::PolicyManager::owner_controlled(MintConfig::OwnerOnly).into());
components.push(mint::owner_controlled::OwnerOnly.into());
// Burn policy manager: active = `owner_only` (burns locked by default), `allow_all`
// is also allowed so the owner can open burns at runtime via `set_burn_policy`.
components.push(burn::PolicyManager::owner_controlled(BurnConfig::OwnerOnly).into());
components.push(burn::owner_controlled::OwnerOnly.into());
components.push(burn::AllowAll.into());
}

// use `AccountCode` to merge codes of agglayer and authentication components
Expand Down
18 changes: 8 additions & 10 deletions crates/miden-agglayer/src/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ use miden_protocol::account::{
use miden_protocol::asset::TokenSymbol;
use miden_protocol::errors::AccountIdError;
use miden_standards::account::access::Ownable2Step;
use miden_standards::account::burn_policies::BurnOwnerControlled;
use miden_standards::account::faucets::{FungibleFaucetError, TokenMetadata};
use miden_standards::account::mint_policies::MintOwnerControlled;
use miden_standards::account::policies::{burn, mint};
use miden_utils_sync::LazyLock;
use thiserror::Error;

Expand Down Expand Up @@ -90,8 +89,7 @@ static METADATA_HASH_HI_SLOT_NAME: LazyLock<StorageSlotName> = LazyLock::new(||
///
/// This component re-exports `network_fungible::mint_and_send`, which requires:
/// - [`Ownable2Step`]: Provides ownership data (bridge account ID as owner).
/// - [`miden_standards::account::mint_policies::MintOwnerControlled`]: Provides mint policy
/// management.
/// - [`miden_standards::account::policies::mint::PolicyManager`]: Provides mint policy management.
///
/// These must be added as separate components when building the faucet account.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -365,12 +363,12 @@ impl AggLayerFaucet {
&*METADATA_HASH_HI_SLOT_NAME,
TokenMetadata::metadata_slot(),
Ownable2Step::slot_name(),
MintOwnerControlled::active_policy_proc_root_slot(),
MintOwnerControlled::allowed_policy_proc_roots_slot(),
MintOwnerControlled::policy_authority_slot(),
BurnOwnerControlled::active_policy_proc_root_slot(),
BurnOwnerControlled::allowed_policy_proc_roots_slot(),
BurnOwnerControlled::policy_authority_slot(),
mint::PolicyManager::active_policy_slot(),
mint::PolicyManager::allowed_policies_slot(),
mint::PolicyManager::policy_authority_slot(),
burn::PolicyManager::active_policy_slot(),
burn::PolicyManager::allowed_policies_slot(),
burn::PolicyManager::policy_authority_slot(),
]
}
}
Expand Down
24 changes: 16 additions & 8 deletions crates/miden-agglayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ use miden_protocol::note::NoteScript;
use miden_protocol::vm::Program;
use miden_standards::account::access::Ownable2Step;
use miden_standards::account::auth::NoAuth;
use miden_standards::account::burn_policies::BurnOwnerControlled;
use miden_standards::account::mint_policies::MintOwnerControlled;
use miden_standards::account::policies::burn::owner_controlled::Config as BurnConfig;
use miden_standards::account::policies::mint::owner_controlled::Config as MintConfig;
use miden_standards::account::policies::{burn, mint};
use miden_utils_sync::LazyLock;

pub mod b2agg_note;
Expand Down Expand Up @@ -208,10 +209,11 @@ pub fn create_existing_bridge_account(
/// The builder includes:
/// - The `AggLayerFaucet` component (conversion metadata + token metadata).
/// - The `Ownable2Step` component (bridge account ID as owner for mint authorization).
/// - The `MintOwnerControlled` component (mint policy management required by
/// `network_fungible::mint_and_send`).
/// - The `BurnOwnerControlled` component (burn policy management required by
/// `basic_fungible::burn`).
/// - The `mint::PolicyManager` + `mint::owner_controlled::OwnerOnly` components (mint policy
/// management and the `owner_only` mint policy required by `network_fungible::mint_and_send`).
/// - The `burn::PolicyManager` + `burn::owner_controlled::OwnerOnly` + `burn::AllowAll` components
/// (burn policy management with `owner_only` as the active policy and `allow_all` also registered
/// as allowed).
#[allow(clippy::too_many_arguments)]
fn create_agglayer_faucet_builder(
seed: Word,
Expand Down Expand Up @@ -241,8 +243,14 @@ fn create_agglayer_faucet_builder(
.storage_mode(AccountStorageMode::Network)
.with_component(agglayer_component)
.with_component(Ownable2Step::new(bridge_account_id))
.with_component(MintOwnerControlled::owner_only())
.with_component(BurnOwnerControlled::owner_only())
.with_component(mint::PolicyManager::owner_controlled(MintConfig::OwnerOnly))
.with_component(mint::owner_controlled::OwnerOnly)
// Burn policy manager: active = `owner_only` (burns locked by default); `allow_all` is
// also registered in the allowed list so the owner can open burns at runtime via
// `set_burn_policy`.
.with_component(burn::PolicyManager::owner_controlled(BurnConfig::OwnerOnly))
.with_component(burn::owner_controlled::OwnerOnly)
.with_component(burn::AllowAll)
}

/// Creates a new agglayer faucet account with the specified configuration.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The MASM code of the `allow_all` Burn Policy Account Component (auth-controlled family).
#
# Exposes the `allow_all` procedure so its MAST root can be registered as the active
# (or allowed) policy on a `BurnPolicyManager`. Storage-free.

pub use ::miden::standards::policies::burn::allow_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The MASM code of the `owner_only` Burn Policy Account Component (owner-controlled family).
#
# Exposes the `owner_only` procedure so its MAST root can be registered as the active
# (or allowed) policy on a `BurnPolicyManager`. Storage-free.

pub use ::miden::standards::policies::burn::owner_controlled::owner_only
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The MASM code of the Burn Policy Manager Account Component.
#
# Owns the three policy-manager storage slots (authority, active_policy_proc_root,
# allowed_policy_proc_roots) and exposes the management procedures. Pair with any
# burn policy component whose procedure root is registered in the allowed-policies map.

pub use ::miden::standards::policies::burn::policy_manager::set_burn_policy
pub use ::miden::standards::policies::burn::policy_manager::get_burn_policy
pub use ::miden::standards::policies::burn::policy_manager::execute_burn_policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The MASM code of the `allow_all` Mint Policy Account Component (auth-controlled family).
#
# Exposes the `allow_all` procedure so its MAST root can be registered as the active
# (or allowed) policy on a `MintPolicyManager`. Storage-free.

pub use ::miden::standards::policies::mint::allow_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The MASM code of the `owner_only` Mint Policy Account Component (owner-controlled family).
#
# Exposes the `owner_only` procedure so its MAST root can be registered as the active
# (or allowed) policy on a `MintPolicyManager`. Storage-free.

pub use ::miden::standards::policies::mint::owner_controlled::owner_only
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The MASM code of the Mint Policy Manager Account Component.
#
# Owns the three policy-manager storage slots (authority, active_policy_proc_root,
# allowed_policy_proc_roots) and exposes the management procedures. Pair with any
# mint policy component whose procedure root is registered in the allowed-policies map.

pub use ::miden::standards::policies::mint::policy_manager::set_mint_policy
pub use ::miden::standards::policies::mint::policy_manager::get_mint_policy
pub use ::miden::standards::policies::mint::policy_manager::execute_mint_policy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# =================================================================================================

use miden::standards::faucets
use miden::standards::mint_policies::policy_manager
use miden::standards::policies::mint::policy_manager

# PROCEDURES
# =================================================================================================
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-standards/asm/standards/faucets/mod.masm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use miden::protocol::faucet
use miden::protocol::native_account
use miden::protocol::output_note
use miden::protocol::asset
use miden::standards::burn_policies::policy_manager
use miden::standards::policies::burn::policy_manager
use miden::protocol::asset::FUNGIBLE_ASSET_MAX_AMOUNT
use miden::standards::metadata::fungible_faucet::TOKEN_METADATA_SLOT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# =================================================================================================

use miden::standards::faucets
use miden::standards::mint_policies::policy_manager
use miden::standards::policies::mint::policy_manager

# PUBLIC INTERFACE
# ================================================================================================
Expand Down
162 changes: 0 additions & 162 deletions crates/miden-standards/src/account/burn_policies/auth_controlled.rs

This file was deleted.

Loading
Loading