Skip to content

Commit

Permalink
fix(ex): wrap Etherscan verification attempts in try/catch blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Nov 19, 2022
1 parent 2adaad0 commit d458d93
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-students-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chugsplash/executor': patch
---

Wrap Etherscan verification attempts in try/catch blocks
66 changes: 39 additions & 27 deletions packages/executor/src/utils/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ export const verifyChugSplashConfig = async (
const chugsplashManagerProxyAddress = getChugSplashManagerProxyAddress(
canonicalConfig.options.projectName
)
await linkProxyWithImplementation(
etherscanApiEndpoints,
etherscanApiKey,
chugsplashManagerProxyAddress,
CHUGSPLASH_MANAGER_ADDRESS,
'ChugSplashManager'
)
try {
await linkProxyWithImplementation(
etherscanApiEndpoints,
etherscanApiKey,
chugsplashManagerProxyAddress,
CHUGSPLASH_MANAGER_ADDRESS,
'ChugSplashManager'
)
} catch (err) {
console.error(err)
}

for (const referenceName of Object.keys(canonicalConfig.contracts)) {
const artifact = artifacts[referenceName]
Expand All @@ -102,27 +106,35 @@ export const verifyChugSplashConfig = async (
)

// Verify the implementation
await attemptVerification(
hre.network.provider,
hre.network.name,
etherscanApiEndpoints,
implementationAddress,
sourceName,
contractName,
abi,
etherscanApiKey,
compilerInput.input,
compilerInput.solcVersion,
constructorArgValues
)
try {
await attemptVerification(
hre.network.provider,
hre.network.name,
etherscanApiEndpoints,
implementationAddress,
sourceName,
contractName,
abi,
etherscanApiKey,
compilerInput.input,
compilerInput.solcVersion,
constructorArgValues
)
} catch (err) {
console.error(err)
}

await linkProxyWithImplementation(
etherscanApiEndpoints,
etherscanApiKey,
proxyAddress,
implementationAddress,
contractName
)
try {
await linkProxyWithImplementation(
etherscanApiEndpoints,
etherscanApiKey,
proxyAddress,
implementationAddress,
contractName
)
} catch (err) {
console.error(err)
}
}
}

Expand Down

0 comments on commit d458d93

Please sign in to comment.