Create the Move Smart Contract
Last updated
Last updated
For this guide we'll create an automation contract that will increment a default value with each automated transaction once the automaton task gets started. We can then use the view function and/or SupraScan to see the updated value, old value, timestamp, and total increments.
This will create your project directory automatically, including a Move.toml
file. This is a manifest file that contains important metadata about your package. This includes the package name, version, dependencies, named addresses, and more.
The SupraFramework
dependency is automatically populated. This framework includes core components that you will interact with during your time on Supra. The framework package includes clearly defined documentation within the /doc
directory for you to review alongside the Move code within the /sources
directory. You can view .
Open the move.toml
file with your code editor. You can find these files on your host machine in the /supra/move_workspace/autofi
directory.
For now, add the below named address to your Move.toml
file and set the value to your address.
Named addresses allow identifiers such as @exampleAddress
to be used throughout your package, rather than hard coding an address value. When compiled into bytecode, any occurrence of the identifier such as @exampleAddress
will be replaced with the value set within the move.toml
file.
Open the move.toml
file with your code editor and set the value to your address to the Profile address of your Supra CLI to Publish the Move Package. Know more about Writing and Publishing your first Move Package at the
And, Within the sources
directory of your package, create the autofi.move
file.