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
Choose 5) Module publish
to select to publish a new module:
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.
You will need to replace the deployer address in
Move.toml
with the multi-sig wallet address;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:
You will need to have aptos cli in system
$PATH
. Check withwhich aptos
.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:
Move code directory that contains file
Move.toml
.Included artifacts as compile arguments. The default compile option is
sparse
.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