Skip to content

Commit 4ba798f

Browse files
committed
throw when a non abstract/interface contract produces no bytecode
1 parent bf172a1 commit 4ba798f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/libraries/ContractCompiler.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ export class ContractCompiler {
103103
if (abi === undefined) continue;
104104
const bytecode = compilerOutput.contracts[relativeFilePath][contractName].evm.bytecode.object;
105105
if (bytecode === undefined) continue;
106-
// don't include interfaces
107-
if (/^I[A-Z].*/.test(contractName)) continue;
108-
// TODO: turn this into an error once we establish naming convention for abstract methods
109-
if (bytecode.length === 0) continue;
106+
// don't include interfaces or Abstract contracts
107+
if (/^(?:I|Base)[A-Z].*/.test(contractName)) continue;
108+
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");
110109

111110
result.contracts[relativeFilePath] = {
112111
[contractName]: {

0 commit comments

Comments
 (0)