Skip to main content
Version: 0.3.1

Odra.toml

As mentioned in the previous article, Odra.toml is a file that contains information about all the contracts that Odra will build. Let's take a look at the file structure again:

[[contracts]]
name = "flipper"
fqn = "sample::Flipper"

The name will be used as a name for the contract - the generated wasm file will be in the above case named flipper.wasm.

The fqn (Fully Qualified Name) is used by the builder to locate the exact struct where the contract is defined.

Adding a new contract manually

Besides using the cargo odra generate command, you can add a new contract to be compiled by hand. To do this, add another [[contracts]] element, name it and make sure that the fqn is set correctly.

For example, if you want to create a new contract called counter, your Odra.toml file should finally look like this:

[[contracts]]
name = "flipper"
fqn = "sample::Flipper"

[[contracts]]
name = "counter"
fqn = "sample::Counter"

What's next

In the next section, we'll take a closer look at the code that was generated by Odra by default - the famous Flipper contract.