Sylvia

Introduction to Sylvia

Sylvia is a framework for building CosmWasm smart contracts with a high level of abstraction.

It’s built on top of crates such as cosmwasm-std and cw-multi-test.

💡
Sylvia contracts are fully interoperable with regular CosmWasm contracts

It allows the users to focus purely on business logic by generating message structures, specifying how their API is (de)serialized, or how to handle message dispatching. Instead, the API of your contract is a set of traits you implement on your contract type.

The framework generates things like entry point structures, functions dispatching the messages, or even helpers for MultiTest. It allows for better control of interfaces, including validating their completeness in compile time.

Sylvia consists of two crates:

  • sylvia - Crate the users should use. Exposes all of the macros from the sylvia-derive and provides some additional utilities.
  • sylvia-derive - Contains all of the Sylvia macros. Do not add this as a dependency on your contract.

While using Sylvia consider using reexported crates like cosmwasm-std and cw-multi-test instead of adding those dependencies yourself as this would lead you to smaller dependencies to maintain.

You can visit docs.rs to learn about the types exposed in the Sylvia.