How to access the json
object key/values abi
and/or bin
?
//File: myFile.json
{
"contracts": {
"ContractName1.sol:ContractName1": {
"abi": "......",
"bin": "......"
},
"ContractName2.sol:ContractName2": {
"abi": "......",
"bin": "......"
},
}
}
I can do the following thing:
const fs = require('fs')
const jsonFile = fs.readFileSync(process.cwd() + '/myFile.json')
const jsonObj = JSON.parse(jsonFile)
jsonObj.contracts. // ??
Unfortunately it is not possible ContractName1.sol:ContractName1
e.g. like this:
jsonObj.contracts.ContractName1.sol:ContractName1.abi