Skip to content

Commit

Permalink
throw when a non abstract/interface contract produces no bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
nuevoalex committed Jan 8, 2018
1 parent bf172a1 commit 4ba798f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/libraries/ContractCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ export class ContractCompiler {
if (abi === undefined) continue;
const bytecode = compilerOutput.contracts[relativeFilePath][contractName].evm.bytecode.object;
if (bytecode === undefined) continue;
// don't include interfaces
if (/^I[A-Z].*/.test(contractName)) continue;
// TODO: turn this into an error once we establish naming convention for abstract methods
if (bytecode.length === 0) continue;
// don't include interfaces or Abstract contracts
if (/^(?:I|Base)[A-Z].*/.test(contractName)) continue;
if (bytecode.length === 0) throw new Error("Contract: " + contractName + " has no bytecode, but this is not expected. It probably doesn't implement all its abstract methods");

result.contracts[relativeFilePath] = {
[contractName]: {
Expand Down

0 comments on commit 4ba798f

Please sign in to comment.