Skip to content

Commit

Permalink
chore: add verification reference in foundry docs (#242)
Browse files Browse the repository at this point in the history
<!--

Thank you for contributing to the ZKsync Docs!

Before submitting the PR, please make sure you do the following:

- Update your PR title to follow [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/)
- Read the [Contributing
Guide](https://github.com/matter-labs/zksync-docs/blob/main/CONTRIBUTING.md).
- Understand our [Code of
Conduct](https://github.com/matter-labs/zksync-docs/blob/main/CODE_OF_CONDUCT.md)
- Please delete any unused parts of the template when submitting your PR

-->

# Description
- Adds reference to zksync verifier option for verification via ZKsync
block explorer
<!-- Please describe what are the changes and what they are solving for
in this PR. -->

## Linked Issues

<!-- If you have any issues this PR is related to, link them here. -->
<!--
Check out
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
on how to automate linking a GitHub Issue to a PR.
-->

## Additional context
  • Loading branch information
dutterbutter authored Oct 11, 2024
1 parent 6d40c0a commit 051784c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/00.build/40.tooling/30.foundry/20.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ contract Greeter {
forge create src/Greeter.sol:Greeter --constructor-args "Hello ZKsync" --account myKeystore --sender <KEYSTORE_ADDRESS> --rpc-url %%zk_testnet_rpc_url%% --chain %%zk_testnet_chain_id%% --zksync
```

### Verifying Contracts with `forge`

You can verify your contracts on the ZKsync block explorer using `forge` by specifying the `zksync` verifier and the appropriate `verifier-url`.
Here's an example command:

```sh
forge create src/Greeter.sol:Greeter \
--constructor-args "Hello ZKsync" \
--account myKeystore \
--sender <KEYSTORE_ADDRESS> \
--rpc-url %%zk_testnet_rpc_url%% \
--chain %%zk_testnet_chain_id%% \
--verifier zksync \
--verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification \
--verify \
--zksync
```

### Deploying Factory Contracts

To deploy contracts like `GreeterFactory.sol`, use the `--zk-enable-eravm-extensions` flag.
Expand Down

0 comments on commit 051784c

Please sign in to comment.