Skip to content

Conversation

@leekt
Copy link
Contributor

@leekt leekt commented Jun 3, 2025

now uses ZERODEV_API_KEY and ZERODEV_PROJECT_ID to cover all supported networks

  • work with etherscan api v2 and verification
    • allow overriding the api by setting {NETWORK_NAME}_VERIFICATION_API_KEY
    • also allow skipping some networks if etherscan api v2 does not work on that network and api is not set
  • update docs

@leekt leekt mentioned this pull request Jun 3, 2025
@leekt leekt requested a review from Copilot June 4, 2025 14:20

This comment was marked as outdated.

@zerodevapp zerodevapp deleted a comment from Copilot AI Jun 4, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zerodevapp zerodevapp deleted a comment from Copilot AI Jun 4, 2025
@Buckram123
Copy link

Thank you so much to taking care of it!

@leekt leekt requested a review from Copilot June 4, 2025 16:15
@leekt leekt merged commit c150d0d into main Jun 4, 2025
2 of 3 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the Zerodev API v3 by fetching supported chains dynamically, updating RPC endpoints and verification flows, and introducing a new chainOption filter in CLI commands.

  • Replaced static chain definitions with an async getSupportedChains fetch from the Zerodev API v3.
  • Updated processAndValidateChains to be async, accept chainOption, and return ZerodevChain objects.
  • Adjusted client RPC URLs (bundler and paymaster) to v3 paths and updated deploy/verify actions to use the new chain model.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/deployContract.test.ts Updated tests for async processAndValidateChains and added a basic getSupportedChains test.
src/utils/validate.ts Made processAndValidateChains async, added chainOption, and changed return type to ZerodevChain[].
src/constant.ts Removed hard-coded chain list; implemented dynamic fetching of chains and project-specific filtering.
src/command/index.ts Made CLI commands async, updated chain display coloring, and wired chainOption into processAndValidateChains.
src/clients/index.ts Updated getZeroDevBundlerRPC and getZeroDevPaymasterRPC to use v3 endpoints.
src/clients/createKernelClient.ts Updated RPC and paymaster URLs to v3 and adapted createPublicClient for the new ZerodevChain.
src/action/verifyContracts.ts Switched to explorerAPI, removed old Etherscan key logic, and added error-exit on any failed verification.
src/action/findDeployment.ts Migrated to ZerodevChain, but updated createPublicClient transport call.
src/action/deployContracts.ts Updated to v3 RPC, added receipt awaits, and fail-fast logic on deployment errors.
package.json, README.md, CHANGELOG.md, .env.example Bumped version/deps, updated docs for ZERODEV_API_KEY/ZERODEV_PROJECT_ID.
Comments suppressed due to low confidence (2)

test/deployContract.test.ts:45

  • [nitpick] Test for getSupportedChains only checks that the return value is defined; consider asserting that chains has expected entries (e.g., non-empty array or contains specific chain names) to improve test coverage.
expect(chains).toBeDefined();

src/clients/index.ts:15

  • getZeroDevPaymasterRPC constructs the same endpoint as getZeroDevBundlerRPC, but the paymaster path should likely be /api/v3/{projectId}/paymaster/{chainId} or similar. Please verify and correct the paymaster endpoint.
let rpc = `https://rpc.zerodev.app/api/v3/${process.env.ZERODEV_PROJECT_ID}/chain/${chainId}`

createPublicClient({
transport: http(getZeroDevBundlerRPC(chain.projectId))
chain: chain,
transport: http()
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In createPublicClient call inside findDeployment, http() is invoked without providing the RPC URL. It should use the chain's RPC URL, for example: transport: http(chain.rpcUrls.default.http[0]).

Suggested change
transport: http()
transport: http(chain.rpcUrls.default.http[0])

Copilot uses AI. Check for mistakes.
chain: chain.viemChainObject,
transport: http(getZeroDevBundlerRPC(chain.projectId))
chain: chain,
transport: http()
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createPublicClient is configured with http() without a URL; it should be provided with the chain's RPC URL, e.g., transport: http(chain.rpcUrls.default.http[0]).

Suggested change
transport: http()
transport: http(chain.rpcUrls.default.http[0])

Copilot uses AI. Check for mistakes.
Comment on lines +115 to +122
chains = chainNames
.map((chainName) =>
supportedChains.find(
(chain) =>
chain.name.toLowerCase() === chainName.toLowerCase()
)
)
.filter((chain) => chain !== undefined)
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Specified chain names that don't match any supported chains are silently dropped. It may be better to report an error or warning if a chainOption entry is not found to avoid silent misconfiguration.

Suggested change
chains = chainNames
.map((chainName) =>
supportedChains.find(
(chain) =>
chain.name.toLowerCase() === chainName.toLowerCase()
)
)
.filter((chain) => chain !== undefined)
const matchedChains = chainNames
.map((chainName) => {
const matchedChain = supportedChains.find(
(chain) =>
chain.name.toLowerCase() === chainName.toLowerCase()
)
if (!matchedChain) {
console.warn(`Warning: Chain name "${chainName}" is not supported and will be ignored.`)
}
return matchedChain
})
chains = matchedChains.filter((chain) => chain !== undefined)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants