Skip to content

Commit

Permalink
#1071 prevent overriding already verified contract
Browse files Browse the repository at this point in the history
 * fix missing check for address/chainId
  • Loading branch information
marcocastignoli committed Jun 21, 2023
1 parent addbde0 commit 7d8603f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/server/controllers/verification/verification.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,19 @@ export const verifyContractsInSession = async (
for (const id in contractWrappers) {
const contractWrapper = contractWrappers[id];

const found = repositoryService.checkByChainAndAddress(
contractWrapper.address as string,
contractWrapper.chainId as string
);
// Check if contract is already verified
if (Boolean(contractWrapper.address) && Boolean(contractWrapper.chainId)) {
const found = repositoryService.checkByChainAndAddress(
contractWrapper.address as string,
contractWrapper.chainId as string
);

if (found.length) {
contractWrapper.status = found[0].status || "error";
contractWrapper.statusMessage = found[0].message;
contractWrapper.storageTimestamp = found[0].storageTimestamp;
continue;
if (found.length) {
contractWrapper.status = found[0].status || "error";
contractWrapper.statusMessage = found[0].message;
contractWrapper.storageTimestamp = found[0].storageTimestamp;
continue;
}
}

await checkAndFetchMissing(contractWrapper.contract);
Expand Down

0 comments on commit 7d8603f

Please sign in to comment.