generate Standrad JSON Input from the Truffle CLI
npm install truffle-plugin-stdjsoninThe Solidity Json Input format is preferred over flattening your files during verification on Etherscan as it :
- preserves code formatting
- maintains multipart files
- embeds compiler settings, including optimization and bytecodehash
yarn add -D truffle-plugin-stdjsonin
`
2. Add the plugin to your truffle-config.js file
`javascript
module.exports = {
/ ... rest of truffle-config / plugins: [
'truffle-plugin-stdjsonin'
]
}
`
Usage
1. Run the plugin on your specified contract name
`
truffle run stdjsonin ContractName
`
A ContractName-Input.json` file is generated in your project directory.