You probably have heard or used Truffle, the leading framework for Solidity smart contracts. But are you aware of all the tools and libraries built by the Truffle team? In this article, we will explore the Github repos of the Trufflesuite organization, to understand their purpose. This is a high-level…
Read StoryI have 3 questions for you. Question 1: Do you know Drizzle, the framework for building Dapp frontend? That can help you massively, and if you don't use it yet, you should watch my video introduction to Drizzle. In a nutshell, Drizzle allow to sync the state of your smart…
Read StoryThe documentation of the Truffle framework is pretty good, but it can be a bit overwhelming for a beginner. This cheatsheet is a condensed version giving you the bare minimum you need to develop Ethereum Dapps on Truffle CLI Init a Truffle project Init a Truffle project WITH code skeleton…
Read StoryIn this episode I am going to introduce you Drizzle, a frontend framework for Ethereum Dapps. We will also build a simple Dapp using this framework, Truffle and React. This will cover: What is drizzle? When do you need it? Integrating Drizzle with other frameworks (React, Truffle, Redux & Saga)…
Read StoryDates are a bit weird in Solidity. Solidity does have some keywords for working with dates, like now, or 1 day, but it does not have a native date type. Instead, dates are represented as integers, using timestamps in seconds. In our Truffle tests, we need to be able to…
Read StoryIn the last video of the smart contract testing series I showed you the basic usage of the Big Number library to deal with integers. But Big Number has many more trick up his sleeves :) In this video, I will show you all these tricks so that you feel…
Read StoryIn Solidity smart contract, you might have to deal with huge numbers, especially when doing financial transfers. Don't forget that we need to specify Ether transfers in Wei, a fundamental unit equals to 1 * 10 ^ -18 Ether, so very quickly even small financial values can lead to big…
Read StoryIn Truffle tests, we have a mysterious contract() function: contract('my test', () => { if('it should ...', () => { }); }); It's Truffle replacement of Mocha describe() function, but with a twist: it defines a "clean room" and it's used to isolate tests. Very few Truffle users, but this…
Read StoryIn Truffle, when you write tests, you can use 'artifacts' and 'web3' objects, without defining these names: const MyContract = artifacts.require('MyContract'); //artifacts was never defined before ! const web3 = new Web3('http://localhost:8545'); //same thing for Web3! How is it possible? this is not valid Javascript! Well, this is what Truffle…
Read StoryIn this video, we will go through the whole process of test-driven-development (TDD) for Solidity smart contracts: writing the tests in Truffle running the failing tests with truffle test fixing the test by implementing the missing parts of the Solidity smart contract running the tests again, this time it will…
Read Story