review comments
This commit is contained in:
parent
7c9e56aebe
commit
d96b51b3c3
2
index.js
2
index.js
|
@ -8,7 +8,7 @@ module.exports = (embark) => {
|
|||
embark.registerConsoleCommand({
|
||||
description: "Flattens all or some of your contracts so that they can be verified on etherscan\n\t\tYou can specify which contract to flatten by using their filename (relative to the contract directory specified in embark.json). For multiple contracts, separate them using a comma",
|
||||
matches: (cmd) => {
|
||||
const [commandName] = cmd.split(' '); // You can use `split` for commands that receive parameters
|
||||
const [commandName] = cmd.split(' ');
|
||||
return commandName === 'flatten';
|
||||
},
|
||||
usage: "flatten or flatten <contracts>",
|
||||
|
|
|
@ -70,7 +70,7 @@ class Flattener {
|
|||
let contractsToFlatten;
|
||||
try {
|
||||
contractsToFlatten = contractNames.map(contractName => {
|
||||
const contract = contracts[Object.keys(contracts).find(contractKey => contracts[contractKey].className === contractName)];
|
||||
const contract = Object.values(contracts).find(contract => contract.className === contractName);
|
||||
if (!contract) {
|
||||
throw new Error('No contract named ' + contractName);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue