> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct ProtocolContracts

Module: `noir_aztec::protocol::abis::protocol_contracts`

```rust
pub struct ProtocolContracts
{ /* private fields */ }
```

## Implementations

```rust
impl ProtocolContracts
```

```rust
pub fn new(derived_addresses: [AztecAddress; 11]) -> Self
```

```rust
pub fn is_magic_protocol_contract_address(contract_address: AztecAddress) -> bool
```

Checks if the given address is a protocol contract address.

```rust
pub fn assert_not_derived_protocol_contract_address(self, contract_address: AztecAddress)
```

```rust
pub fn get_derived_address(
    self,
    magic_protocol_contract_address: AztecAddress,
) -> AztecAddress
```

Obtains the derived address for the given magic protocol contract address.

Important! This assumes that the caller has already validated that the address is indeed a magic protocol contract address by calling `is_magic_protocol_contract_address` first, because this function fails if the input address is not a valid magic protocol contract address.

```rust
pub fn hash(self) -> Field
```

## Trait implementations

```rust
impl Deserialize for ProtocolContracts
```

```rust
pub fn deserialize(fields: [Field; 11 * 1]) -> Self
```

```rust
pub fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self
```

```rust
impl Empty for ProtocolContracts
```

```rust
pub fn empty() -> Self
```

```rust
pub fn is_empty(self: Self) -> bool
where
    Self: Eq
```

```rust
pub fn assert_empty<let S: u32>(self: Self, msg: str<S>)
where
    Self: Eq
```

```rust
impl Eq for ProtocolContracts
```

```rust
pub fn eq(_self: Self, _other: Self) -> bool
```

```rust
impl Serialize for ProtocolContracts
```

```rust
pub fn serialize(self) -> [Field; 11 * 1]
```

```rust
pub fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>)
```
