> 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/sdk/smart-contract-or-deploy-a-move-module.md).

# Smart Contract | Deploy a MOVE Module

`scripts/deploy.ts` is the script used to deploy the move module.

You will need to finish the following items as the prerequisite before calling this script.

1. You have ready have a MSafe wallet created with the account in `config.yaml` in step 1.
2. Deployer address is replaced with the MSafe address in `Move.toml`
3. MOVE module is compiled with flag `--save-metadata`

After compiled the move module, call

```
yarn run deploy --msafe ${MSAFE_ADDRESS} --move-dir ./tests/move
```

There is some test contracts in folder `./test/move` that you may try it out.

```
Action:			Module publish
Verify Hash:		0x80e3c2779b714ab355ecc6fc4c8db221e770adb127a18ebfb150f11d9ca65edc
Deployer:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Package:		MomentumSafe-test
Upgrade Policy:		compatible
Upgrade Number:		0
Source Digest:		BC36D67FB3DE5ABD5541BCAF633C28E1EFECF0DDDED20544296DCA98F744DE82
Modules:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message
			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::test_coin
Dependency:		0x0000000000000000000000000000000000000000000000000000000000000001::AptosFramework
			0x0000000000000000000000000000000000000000000000000000000000000001::AptosStdlib
			0x0000000000000000000000000000000000000000000000000000000000000001::MoveStdlib
Sender:			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Sequence Number:	8
Expiration:		Thu Oct 13 2022 18:00:20 GMT-0700 (Pacific Daylight Time)
Gas Price:		100
Max Gas:		5000

--------------------

Do you confirm with the transaction? [Y/n]
```

The script will load compiled move modules from move directory and print message about the code deployment.

After confirm, the transaction to initiate the multi-sig transaction request will be confirmed on blockchain. You may confirm the transaction and submit the signature through interactive CLI or Web App.


---

# 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:

```
GET https://doc.m-safe.io/aptos/developers/sdk/smart-contract-or-deploy-a-move-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
