MSafe | Aptos
  • Overview
    • MSafe Overview
    • What can you do with MSafe wallet?
      • Why Multi-Sig & Non-Custodial
      • MSafe Wallet Key Benefits
    • Use Cases
      • Treasury Management
      • Smart Contract Deployment & Update
      • Protocol Admin Control
      • dApp Store Integration
    • Security
  • Users
    • Glossary
    • Launch App
    • Connect Wallet
    • Navigation Bar
    • Address Book
    • Create an Account
      • Initiate Creation
      • Co-Managers to Accept
    • Switch btw Accounts
    • Deposit / Receive
    • View Assets
    • View Pending Txn
    • View Txn History
    • Propose Transaction (Enable NFT, Send, Register Coin)
      • Enable NFT
      • Send
      • Add Coin
    • Approve Transaction
      • Co-Managers to Approve Enable NFT
      • Co-Managers to Approve Send
      • Co-Manager to Approve Add Coin
    • Change Vote
    • Reject Transaction
      • Co-Managers to Reject
    • Execute Transaction
      • Execute Approval
      • Execute Rejection
    • App Store
      • Use dApps
    • MSafe 1.0 User guide
      • Connect Wallet
      • First time registration
      • Create an MSafe Account
      • Receive Coin
      • Coin Transfer (APT)
      • DAPP Store
      • Add a new coin
      • Address Book
      • Permissions
      • Wallet FAQs
  • Developers
    • Overview
    • System
      • Auth-key & Multi-Ed25519
      • Backend Walk Through
      • MSafe Contracts
    • Interactive CLI
      • Installation
      • CLI arguments
      • Register and View
      • Create a MSafe Wallet
      • Approve / execute a transaction
      • Transfer Coin
      • Smart Contract | Module Publish
      • Entry Function
      • Reject a transaction
      • Migration from MSafe 1.0 to MSafe 2.0
    • SDK
      • Smart Contract | Deploy a MOVE Module
      • Call An Entry Function
    • Integrate with MSafe (DAPP)
      • FAQ
    • Move Module Publish
  • Product updates
    • 2022 Q4
Powered by GitBook
On this page
  • Initiate a call to an entry function
  • Confirm for other owners
  1. Developers
  2. Interactive CLI

Entry Function

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

You can call any MOVE entry function with MSafe. Other than Transfer Coin and Smart Contract | Module Publish, popular use cases are:

  1. Protocol parameter change;

  2. Emergency control;

  3. Interact with any MOVE module.

Initiate a call to an entry function

Select a created MSafe account, and select n) New transaction to initiate a new transaction. Select 4 to call a module function.

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

Select module

Then the terminal will prompt arguments for which module to interact with:

Start Custom module interaction

	Module name (E.g. 0x1::coin):		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message

Pulling ABI from chain...

Select entry function

After inputing the published module name, the MSafe CLI will fetch ABI data from blockchain, and display public entry functions:

Please select the function you want to interact with:

	1)	set_message
	b)	Back

Please input your option:		1

In this case, there is only one public entry function set_message from the module ABI. Select the function, and input the parameters which is the input to the function.

Note at this stage, calling an entry function only allows limited type of arguments, including:

  1. u128, u64, u32, u16, u8

  2. address

  3. &signer

  4. vector<u8>

We will support more types shortly.

Input type arguments

First input the number of type arguments. In this case, we do not have type arguments inputs with the entry function signature. Thus, input 0 for Number Type Arguments.

Number Type Arguments:		0

For other functions that take type arguments as input, input the number of arguments and fill in the full name of the argument (E.g. 0x1::coin::CoinInfo).

Input function arguments

The ABI contains function argument types. Follow the instructions to input all parameters:

Start to input arguments:

	1: Type signer			&signer
	2: Type 0x1::string::String	"hello momentum safe"

Note that the signer object is automatically filled in since it cannot be parsed in but through signature verification in MOVE vm.

Confirm and submit

Transaction confirmation:

Action:			Entry function
Call function:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message
Arguments (1):		[string]	"hello momentum safe"
Sender:			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Sequence Number:	4
Expiration:		Sun Oct 09 2022 11:58:45 GMT-0700 (Pacific Daylight Time)
Gas Price:		100
Max Gas:		5000

Confirm with transaction details, and submit on chain

Transaction information correct? [Y/n]

	Transaction 0x121f435278c7e48a49d421cc60951b053c17fe050a8b39047f9145280294e740 submitted to blockchain
	Transaction confirmed on chain.

Confirm for other owners

For other owners, confirm and execute the transaction either on CLI or web application.

Pending transactions:

		| SN	| Action			| Confirmation	|

	1)	| 4	| Entry Function		| 1 / 2
	n)	New transaction
	r)	Refresh
	b)	Back
PreviousSmart Contract | Module PublishNextReject a transaction

Last updated 2 years ago

Here we simply use the message module in . The move src file is also included in the CLI-MSafe repository, and under ./tests/move.

Aptos move example