> For the complete documentation index, see [llms.txt](https://doc.m-safe.io/aptos/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.m-safe.io/aptos/developers/system/msafe-contracts.md).

# MSafe Contracts

### Deployed Smart Contract

* Devnet:&#x20;

  ```
  0x74f14286e43d27ed0acc0c4548a5be99a7c2af3cf17a1344c87b7f026b2fcc23
  ```
* Testnet:&#x20;

  ```
  0x74f14286e43d27ed0acc0c4548a5be99a7c2af3cf17a1344c87b7f026b2fcc23
  ```
* Mainnet

  ```
  0xaa90e0d9d16b63ba4a289fb0dc8d1b454058b21c9b5c76864f825d5c1f32582e
  ```

{% hint style="info" %}
In the following entry function, the deployed smart contract address is represented as `@msafe`.
{% endhint %}

### Entry functions

#### @msafe::creator

Helper module used for MSafe creation and registration.

```
public entry fun init_wallet_creation(
    s: &signer,
    owners: vector<address>,    
    threshold: u8,    
    init_balance: u64,    
    payload: vector<u8>,    
    signature: vector<u8>,
) acquires PendingMultiSigCreations, MultiSigCreationEvent
```

```
public entry fun submit_signature(
    msafe_address: address,
    pk_index: u64,
    signature: vector<u8>,
) acquires PendingMultiSigCreations, MultiSigCreationEvent
```

```
public entry fun clean_expired_creation(
    msafe_addresses: vector<address>
) acquires PendingMultiSigCreations
```

#### @msafe::momentum\_safe

Main module for storing MSafe transaction payload and signatures.&#x20;

```
public entry fun register(
    msafe: &signer,
    metadata: vector<u8>
)
```

```
public entry fun init_transaction(
    msafe_address: address,
    pk_index: u64,
    payload: vector<u8>,
    signature: vector<u8>,
) acquires Momentum, MomentumSafeEvent
```

```
public entry fun submit_signature(
    msafe_address: address,
    pk_index: u64,
    tx_hash: vector<u8>,
    signature: vector<u8>
) acquires Momentum, MomentumSafeEvent
```

```
public entry fun do_nothing()
```

#### @msafe::registry

Store MSafe addresses owned by an address.

```
public entry fun register(
    s: &signer,
    public_key: vector<u8>,
)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.m-safe.io/aptos/developers/system/msafe-contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
