Skip to Content

Compile and Publish

Compile the package, fund your account and publish the package to your network.

--help describes a command’s arguments, for example supra move tool publish --help. The commands on this page use the active profile, and send transactions to the network that profile is for.

Compile your package

--package-dir can be left out when the current directory is the package’s root, where Move.toml is.

Compiling fetches the dependencies in Move.toml, then builds the package into a new build directory that holds its bytecode. The first compile downloads the SupraFramework repository, which can take several minutes.


execute me!
supra move tool compile --package-dir /supra/move_workspace/exampleContract

Fund your account

Publishing costs gas, paid in SUPRA from the account that publishes. On Devnet and Testnet, get SUPRA from the network’s faucet:

execute me!
supra move account fund-with-faucet

Mainnet has no faucet. To publish on Mainnet, the account needs SUPRA from another source.

Publish your package

Once the package is compiled and the account has SUPRA for gas, publish the package:

execute me!
supra move tool publish --package-dir /supra/move_workspace/exampleContract

The CLI asks you to confirm the gas unit price. Press Enter to accept it, or enter a different price in quants. --accept-defaults accepts it without asking.

publish --simulate runs the publish without sending it and reports the gas it would use. It needs the account to exist on chain, so fund the account first. For an account that has not been funded, it fails with Resource not found: 0x1::account::Account, which Devnet returns as 404 Not Found and Testnet and Mainnet return as 400 Bad Request.

To use a profile other than the active one, pass --profile <PROFILE_NAME> to a command, or make it the active profile with supra profile activate <PROFILE_NAME>.

Last updated on