Skip to main content

aztec_core/
constants.rs

1//! Well-known protocol contract addresses.
2//!
3//! These addresses are deterministic and identical across all Aztec networks.
4
5use crate::types::{AztecAddress, Fr};
6
7/// Well-known protocol contract addresses.
8pub mod protocol_contract_address {
9    use super::*;
10
11    /// The Fee Juice contract — manages fee token balances and claims.
12    ///
13    /// In the TS SDK this is `ProtocolContractAddress.FeeJuice` with
14    /// the numeric value `5` (see `constants.gen.ts: FEE_JUICE_ADDRESS = 5`).
15    pub fn fee_juice() -> AztecAddress {
16        AztecAddress(Fr::from(5u64))
17    }
18}
19
20#[cfg(test)]
21#[allow(clippy::expect_used)]
22mod tests {
23    use super::*;
24
25    #[test]
26    fn fee_juice_address_is_5() {
27        let addr = protocol_contract_address::fee_juice();
28        assert_eq!(addr, AztecAddress(Fr::from(5u64)));
29    }
30}