Flattening your Solidity files

Qayyum Rajan, CFA
Coinmonks

--

This article is geared towards those that are beginning to interact with smart contracts in ethereum.

I’ve been through this a few times — and for those just starting in the space — this can somewhat be an annoying process — especially when trying to get verified on Etherscan.io

Typically your files will be in a combination of subfolders — and this article is meant to give a more detailed overview for those that want to get their contracts source code verified. We will do this from scratch for those not familiar with using npm and the terminal.

We will be using the POA Solidity Flattener found here (clone this to your local directory): https://github.com/poanetwork/solidity-flattener

The first thing first is to install NPM here.

To use some reference files — we can use some token contracts from openzepplin who provides an awesome collection of free smart contracts.

Open in Github Desktop, download the zip or clone the repo — whatever works for ya (I personally like Github Desktop).

Get the repo

We can use contracts/token/ERC20/ERC20Mintable.sol — This is a standard mintable token.

--

--