Configuring Truffle

When we first set up Truffle, we created a file in the erc-20-token folder called truffle-config.js. Open a terminal in the erc-20-token folder with all of the contracts. Your folder should look something like this:

The first thing that we will do is edit the truffle-config.js file. In this file you can configure the following:

  • the network you want to send the smart contracts to

  • the compiler that you want to compile your contracts

  • additional parameters we can play around with, which we'll explore later in the chapter

At the top of the truffle-config.js file, create a module.exports object.

In this empty export object, we will add an object for networks and another for compilers.

Let's go through what information we can capture in each of these objects.


We will tell Truffle what version of the Solidity compiler to use to process the smart contracts we are writing. In addition to specifying the version we can also specify other parameters for the compiler.

In the compilers section, add an object: solc, so our compilers object will look like this:

solc is the compiler we will be using to process our smart contracts. In solc, we will configure the version and the settings. In the settings object we can modify the optimizer settings and state the evmVersion as well.


This page is a preview of Creating an ERC20 Token on Ethereum

No discussions yet