foundry-rs / starknet-foundry

Blazing fast toolkit for developing Starknet contracts.
https://foundry-rs.github.io/starknet-foundry/
MIT License
279 stars 138 forks source link

Contract verification #2252

Open barabanovro opened 1 week ago

barabanovro commented 1 week ago

Closes #892

Introduced changes

This PR builds upon the changes introduced in PR #875. The original PR is still open because the Voyager APIs are not ready yet, but we require the verification feature for the Walnut Debugger. To accommodate this, we have incorporated the changes from PR #875 and made the following additions:

Furthermore, to make the PR merge-ready, we have temporarily removed the Voyager and Starkscan interfaces since their respective APIs are not currently available. New verification interfaces can be added once Voyager, Starkscan, or any other provider adds API support for Cairo contract verification.

This Pull Request adds the verify command for the contract verification. More about the details of the contract verification can found here.

Checklist

barabanovro commented 1 week ago

Hey @Arcticae 👋 I am asking for a preliminary review, mainly involving the automated tests — could you shed more light on how to approach them?

barabanovro commented 20 hours ago

I've addressed the PR comments and implemented tests using mock APIs with wiremock. I have used the WALNUT_API_URL env variable to pass the mock server URL to the verify command.

I'll be adding the documentation today.