Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Handle contract name not matching file name. #39

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/contracts.es6
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ var Contracts = {
return;
}

if(result[key] == null && Object.keys(result).length > 0) {
var contractName = Object.keys(result)[0];
if ((contractName.toUpperCase() == key.toUpperCase()) && (contractName != key)) {
callback(new Error("Could not get compiler results because contract name '" + contractName + "' is not identical to file name '" + key + "'."));
return;
}
}

contract["binary"] = result[key].code;
contract["abi"] = result[key].info.abiDefinition;
finished(null, contract);
Expand Down