A couple of weeks ago I have started diving into smart-contract / web3 development (for educational purposes) and have been experimenting with ERC-725 and ERC-734. While I was doing so, I was trying to figure out a setup that suited me personally.

  • A good “debugging experience” -> Hardhat
  • Type safety -> Typescript & Typechain
  • Speed -> Jest & Wallaby.js

In my dev environment as a frontend-developer I am used to Jest and Wallaby.js.

Wallaby.js is a developer productivity tool that runs your JavaScript and TypeScript tests immediately as you type, highlighting results in your IDE right next to your code.

Hardhat ๐Ÿ‘ทโ€โ™€๏ธ๐Ÿ‘ทโ€โ™‚๏ธ

Hardhat (formerly Buidler) is a development environment to compile, deploy, test, and debug your Ethereum software. You get Solidity stack traces, console.log and explicit error messages when transactions fail.

Typescript & Typechain ๐Ÿ‘ฎ

If you are using Typescript, Typechain made by Kris Kaczor is a must have in your workflow in my opinion. And it’s very simple to integrate too. Check it out, and give it a star if you like it.

import { utils, ethers } from 'ethers';
import { DaiFactory } from '../types/ethers-contracts/DaiFactory';

const RPC_HOST = 'https://mainnet.infura.io/v3/6d6c70e65c77429482df5b64a4d0c943';
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F';

async function main() {
  const provider = new ethers.providers.JsonRpcProvider(RPC_HOST);
  const dai = DaiFactory.connect(DAI_ADDRESS, provider);
  const balance = await dai.balanceOf('0x70b144972C5Ef6CB941A5379240B74239c418CD4');

  console.log(`Our DAI balance is: ${utils.formatEther(balance)}`);

main().catch((e) => {

Jest & Wallaby.js ๐Ÿš€ 

In terms of testing, Hardhat uses Mocha by default. However since it’s designed to be extensible, it was quite simple to create a proof of concept plugin (hardhat-jest-plugin) that utilizes Jest.


The plugin extends hardhat with a test:jest task. You can also start the watch mode via the --watch flag, however that just watches the test-files, not the solidity files (yet). I’m hoping to be able to solve this next week. If anyone wants to help, there is a lot of work to be done, pull-requests are more than welcome.

Hardhat and Jest

Im currently working on getting Wallaby.js and Jest play nice when used standalone. This part is WIP. I will update the blogpost as soon as this is sorted out.

Example Project / Code

I have integrated all the tools mentioned above in my playground repository. You can have a look there. Since I’m new to the space (evm / smart-contracts) be careful when copying my stuff. Nothing in there is ready for production.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: