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]]
fqn = "sample::Flipper"
The fqn
(Fully Qualified Name) is used by the building tools to locate and build the contract.
The last segment of the fqn
will be used as the name for your contract - the generated wasm file will
be in the above case named flipper.wasm
.
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]]
fqn = "sample::Flipper"
[[contracts]]
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.