Skip to content

Conversation

@MaxMustermann2
Copy link
Contributor

When running forge script, use the following methods to create the Etherscan client, in order of priority

  • --verifier-url flag
  • foundry.toml configuration
  • foundry_block_explorers crate

Since the foundry_block_explorers appears to require that the browser_url be set, introduce a new user-facing configuration option to that effect.

Use case
Before this PR on forge version 0579449 with imua-xyz/imua-contracts@075d333, we get the following error.

source .env
forge script script/18_SimulateReceive.s.sol --rpc-url imuachain_testnet
[⠊] Compiling...
No files changed, compilation skipped
Error: Chain 233 not supported

With this PR included, the chain's explorer is recognized and the script is run.

source .env
forge script script/18_SimulateReceive.s.sol --rpc-url imuachain_testnet
[⠊] Compiling...
No files changed, compilation skipped
Traces:
  [832568] → new SimulateReceive@0x9f7cF1d1F558E57ef88a59ac3D47214eF25B6A06
    └─ ← [Return] 4048 bytes of code

  [2912] SimulateReceive::run()
    ├─ [0] VM::readFile("./scanApiResponse.json") [staticcall]
    │   └─ ← [Revert] vm.readFile: failed to open file "/home/user/Documents/Work/Exocore/exocore-contracts/scanApiResponse.json": No such file or directory (os error 2)
    └─ ← [Revert] vm.readFile: failed to open file "/home/user/Documents/Work/Exocore/exocore-contracts/scanApiResponse.json": No such file or directory (os error 2)


Error: script failed: vm.readFile: failed to open file "/home/user/Documents/Work/Exocore/exocore-contracts/scanApiResponse.json": No such file or directory (os error 2)

The explorer is recognized even with the following patch applied to imua-xyz/imua-contracts@075d333

diff --git a/foundry.toml b/foundry.toml
index 1e6e91b..966c8d1 100644
--- a/foundry.toml
+++ b/foundry.toml
@@ -65,6 +65,6 @@ imuachain_testnet = "${IMUACHAIN_TESTNET_RPC}"
 mainnet = { key = "${ETHERSCAN_API_KEY}" }
 sepolia = { key = "${ETHERSCAN_API_KEY}" }
 holesky = { key = "${ETHERSCAN_API_KEY}" }
-imuachain_testnet = { key = "${ETHERSCAN_API_KEY}", chain = 233, url = "${IMUACHAIN_TESTNET_EXPLORER_API}" }
+imuachain_testnet = { key = "${ETHERSCAN_API_KEY}", url = "${IMUACHAIN_TESTNET_EXPLORER_API}" }
 
 # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

When running `forge script`, use the following methods to create the
Etherscan client, in order of priority
- `--verifier-url` flag
- `foundry.toml` configuration
- `foundry_block_explorers` crate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant