extern crate alloc;
use alloc::collections::{BTreeMap, BTreeSet};
use miden_protocol::account::{AccountProcedureRoot, RoleSymbol};
use miden_protocol::note::NoteScriptRoot;
use miden_standards::account::auth::AuthNetworkAccount;
use miden_standards::account::fees::ConstantFeeManager;
use miden_standards::note::config::{ConstantFeePolicyConfigNote, RbacConfigNote};
use miden_standards::note::{BurnNote, MintNote};
use miden_utils_sync::LazyLock;
static FEE_MANAGER_ROLE: LazyLock<RoleSymbol> =
LazyLock::new(|| RoleSymbol::new("FEE_MNGR").expect("FEE_MNGR role symbol should be valid"));
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AggLayerFaucet;
impl AggLayerFaucet {
pub fn fee_manager_role() -> RoleSymbol {
FEE_MANAGER_ROLE.clone()
}
pub fn procedure_roles() -> BTreeMap<AccountProcedureRoot, RoleSymbol> {
BTreeMap::from([(ConstantFeeManager::set_note_fee_root(), Self::fee_manager_role())])
}
pub fn allowed_notes() -> BTreeSet<NoteScriptRoot> {
let mut notes = BTreeSet::from([
MintNote::script_root(),
BurnNote::script_root(),
ConstantFeePolicyConfigNote::script_root(),
RbacConfigNote::script_root(),
]);
notes.extend(AuthNetworkAccount::default_allowed_note_scripts());
notes
}
}