[Ethereum] Flatten Truffle Solidity Contracts for Etherscan’s `Verify Contract Code` Feature

abietherscansoliditytruffle

Etherscan.io has a Verify Contract Code feature that takes the inputs Solidity Contract Code and Constructor Arguments ABI-encoded.

Question: Is there a tool to flatten your solidity contracts (written in conjunction with the use of Truffle), and maybe even generate the ABI-encoded constructor arguments, so as to speed up your use of Etherscan's contract verification feature?

Tried Blockcat's python script solidity-flattener but could never get it to work. Hoping to discover a new alternative method.

Best Answer

I've used this one in the past, with very good results and minimal setup: https://github.com/oraclesorg/oracles-combine-solidity

git clone https://github.com/oraclesorg/oracles-combine-solidity
cd oracles-combine-solidity
npm install
npm start "path_to_not_flat_contract_definition_file.sol"