Our advances with EasyElm-EOS

Check out the progress we made on EasyElm-EOS after the Pomelo 4th season

Henrique Buss
Cambiatus
2 min readApr 13, 2023

--

An illustration of people around a laptop with Elm code. "Type-safe interaction between EOSIO and Elm" written above it

Before we talk about how we advanced with the tool, let's first talk about what it is.

What is EasyElm-EOS?

EasyElm-EOS is an open source tool developed internally at Cambiatus that makes it easier and faster to integrate EOS contracts with the Elm programming language.

What problem does it try to solve?

Interacting with contracts from web apps can be challenging. We need to send the data in the correct format, which is very easy to get wrong and can be a difficult problem to diagnose. At development time, application developers need to consult the contract implementation (or a block explorer) to find out what data the contract accepts. The developer also needs to “translate” the data — from the app’s language to the language the contract understands. Furthermore, if a team makes any changes to the contract, it can be difficult for other teams to notice this change and adapt the application, which can lead to errors for end users.

How do we solve these problems?

We're using the ABIs (Application Binary Interfaces), that describe how EOS contracts work to generate code in Elm, so that it makes it easier to interact with the contracts from an Elm application.

Because of Elm's guarantees and features, having generated code makes it impossible to send incorrectly formatted data. They also help web developers to move faster when integrating EOS contracts — the generated code has all the information that a developer may need to interact with the contracts. This way, developers don't need to get out of their flow to look at the implementation of the contract, or look it up in a block explorer. Developers also don't need to translate data from Elm to JSON (which is what we use to talk to EOS contracts).

Is this tool a public good?

Yes! Any developer can use it for their projects for free, and it's all open source. The tool can generate starter apps, JSON encoders/decoders, and types that represent the contract's tables and actions. Anyone can use and contribute to the tool.

Our advancements

All of our deliverables for the 4th Pomelo campaign are done! Here they are:

  1. GitHub repository: this has all of the source code, along with documentation and usage instructions and examples
  2. Elm package (source)
  3. App starter (source)
  4. Code generator npm package (source)
  5. Usage examples (from less complex to more complex):
    1. Member fetching example (source)
    2. Transfer example (source): to login, use a base58 key, which you can export from the Cambiatus webapp.
    3. Contract explorer example (source): to login, install SimplEOS and import a Cambiatus staging account

--

--

Henrique Buss
Cambiatus
Writer for

Front-end web developer who loves functional programming 👨‍💻