TrueFi Engineering
Published in

TrueFi Engineering

Introducing Waffle

If you care about the quality of your software, you care about tests. If you care about tests, you care about syntax and speed. We find a good testing framework is essential for creating quality software. Which brings us to smart contracts.

Today testing smart contracts seem cumbersome and tedious. Frameworks have verbose syntax and make it hard to formulate precise expectations.

And so we would like to announce waffle — a framework for testing smart contracts. It allows you to write short but expressive tests.

Waffle is simpler and sweeter than Truffle.

For example, it is easy to check what was the reason for a revert:

It is easy to check which event was emitted and with what arguments:

I hope the code above is pretty self-explanatory. Here is a more complete example with a couple of tests written for OpenSolidity ERC20 based token:

Waffle is aiming to replace Truffle. It is simpler, faster and easier to learn and use. However, it only focuses on testing and not on creating applications.

About Waffle

Waffle tastes best with ES6.

It is based on ethers.js and mocha.

Ethers.js is a stable, small and robust js lib for accessing ethereum. It gained a lot of traction recently and seems to be on the way to be the standard js JSON RPC abstraction.


We tested Waffle for a couple of months now and it works well for us. Our next goal is speed. On our roadmap you can find:
- faster contract compilation
- faster test execution
- support for running tests with Geth (aside from ganache)
and more!

Getting started

To learn more and start using visit Waffle GitHub.

What about Mocking?

Do you miss mocking smart contract functionality? Check our other library doppelgänger.

Get updates

If would like to get updates on what we do — follow us on Medium and if you like the story 👏 👏 👏.

If you would like to get updates on Waffle ⭐️ and follow us waffle GitHub.

Team working on TrueFi talks about OSS (useDApp and Waffle), good software engineering practices and more!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Marek Kirejczyk

Marek Kirejczyk

Ethereum blockchain Engineer. Ethworks, Universal Login.

More from Medium

Solidity Tutorial: Reference Types

Right way to transfer ETH in a smart contract

Ownership Exploitation in Solidity

Ethernaut Solutions 1–15, Part 1