diff --git a/packages/lib-sourcify/src/lib/verification.ts b/packages/lib-sourcify/src/lib/verification.ts index 7e6ac8175..e012fd5d8 100644 --- a/packages/lib-sourcify/src/lib/verification.ts +++ b/packages/lib-sourcify/src/lib/verification.ts @@ -47,6 +47,15 @@ export async function verifyDeployed( }; const recompiled = await checkedContract.recompile(); + if ( + recompiled.deployedBytecode === '0x' || + recompiled.creationBytecode === '0x' + ) { + throw new Error( + `The compiled contract bytecode is "0x". Are you trying to verify an abstract contract?` + ); + } + const deployedBytecode = await getBytecode(sourcifyChain, address); // Can't match if there is no deployed bytecode @@ -369,6 +378,7 @@ export async function matchWithCreationTx( match.message = `Failed to match with creation bytecode: recompiled contract's creation bytecode is empty`; return; } + const creatorTx = await getTx(creatorTxHash, sourcifyChain); const creatorTxData = creatorTx.input;