Smart Contract | Module Publish

MSafe supports move module deployment. By using MSafe to deploy the smart contract, you will greatly reduce the risk of the single signed deployer account taking over the smart contract, and upgrade the smart contract to an arbitrary logic. By using momentum safe to publish a module, it will making the protocol code logics more secure and decentralized.

In this page, we will walk through the process of code deployment with the a MSafe wallet.

If you haven't created a MSafe wallet, please follow the instruction Create a MSafe Wallet to create a new MSafe wallet.

Initiate a module deploy

First, open an interactive CLI and select the MSafe wallet to deploy the MOVE module.

When entering MSafe details information, select n) New transaction

No pending transactions.

	n)	New transaction
	r)	Refresh
	b)	Back

Please input your option:		n

Choose 5) Module publish to select to publish a new module:

Please choose your transaction type

	1)	Transfer APT
	2)	Transfer COIN
	3)	Register COIN
	4)	Custom module interaction
	5)	Module publish

Please input your option:		5

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

Start Module publish

Do you want to compile the MOVE module? [y/N]

Then the prompt will ask whether you want MSafe CLI to compile the MOVE module before publishing the module.

Compile

(Option 1) Choose not to compile MOVE module (default)

If you choose not to compile, you will need to compile the move module before continue.

  1. You will need to replace the deployer address in Move.toml with the multi-sig wallet address;

  2. You need to compile the MOVE module with specifying --save-metadata and --included-artifacts.

Then input the move directory into and the CLI tool will load the move module for you.

(Option 2) Choose to let CLI compile MOVE module

If you choose to let CLI to compile the MOVE module for you, you will need to do the following prerequisites:

  1. You will need to have aptos cli in system $PATH. Check with which aptos.

  2. You will need to have deployer address value replaced with _. CLI will automatically configure the deploy address for you. E.g.

The CLI will prompt three inputs, and they are:

  1. Move code directory that contains file Move.toml.

  2. Included artifacts as compile arguments. The default compile option is sparse.

  3. Deployer address name as specified in Move.toml. In this case, msafe.

Then the CLI will compile the MOVE module for you, and the result will be shown after a successful compile.

Publish module

After compile or load the MOVE from directory, the CLI will print the package information:

Note that there is a Verify Hash in the confirmation which can be used to verify the deploy content for other owners.

Confirm with yes, and the transaction to initiate the module publish transaction is submitted on blockchain.

Confirm and sign for other owners

The other owners are able to sign and submit signatures either in CLI or Web App.

If the user want to sign in CLI, he may go to the corresponding wallet, select the module publish transaction, sign and submit the transaction on blockchain.

Last updated