Deploy Move Contract

This article guides you on how to compile and deploy a Move contract to the starcoin blockchain.

Move is a new programming language developed to provide a safe and programmable foundation for the Libra Blockchain.Starcoin Blockchain also support Move language to write smart contract.

First start a dev network as described in Run/Join Network, and get some coins, say 1000000000.

Then, let contracting!

  1. create a simple module, say: MyCounter.
module MyCounter {
     use 0x1::Signer;

     resource struct T {
     public fun init(account: &signer){
        move_to(account, T{value:0});
     public fun incr(account: &signer) acquires T {
        let counter = borrow_global_mut<T>(Signer::address_of(account));
        counter.value = counter.value + 1;


the source file at

  1. compile the module.

In starcoin console, run:

starcoin% dev compile examples/my_counter/module/MyCounter.move

It will compile the module, and output the bytecode to under the temp directory.

  1. unlock your default account.
starcoin% account unlock
account 759e96a81c7f0c828cd3bf1cc84239cb unlocked for 300s
  1. deploy module
starcoin% dev deploy /Users/jolestar/.starcoin/cli/dev/tmp/6e0f73c87b0a0c6c4e8d77ca4a3a9c48/
txn 3c957f688c628e7ce2a4e1c238b14505b9cf6068aa3da897f555474ee7b2dd0b submitted.
  1. write script to call module. //TODO

  2. use state cmd to query account state. //TODO