@@ -30,12 +30,17 @@ type Verifier struct {
30
30
numFailed int
31
31
}
32
32
33
- func NewVerifier (apiKey string , l1ChainID uint64 , artifactsFS foundry.StatDirFs , l log.Logger , l1Client * ethclient.Client ) (* Verifier , error ) {
34
- etherscanUrl , err := getAPIEndpoint (l1ChainID )
35
- if err != nil {
36
- return nil , fmt .Errorf ("unsupported L1 chain ID: %d" , l1ChainID )
33
+ func NewVerifier (apiKey string , l1ChainID uint64 , artifactsFS foundry.StatDirFs , l log.Logger , l1Client * ethclient.Client , etherscanUrl string ) (* Verifier , error ) {
34
+ if len (etherscanUrl ) == 0 {
35
+ var err error
36
+ etherscanUrl , err = getAPIEndpoint (l1ChainID )
37
+ if err != nil {
38
+ return nil , fmt .Errorf ("unsupported L1 chain ID: %d" , l1ChainID )
39
+ }
40
+ l .Info ("found etherscan url" , "url" , etherscanUrl )
41
+ } else {
42
+ l .Info ("using provided etherscan url" , "url" , etherscanUrl )
37
43
}
38
- l .Info ("found etherscan url" , "url" , etherscanUrl )
39
44
40
45
etherscan := NewEtherscanClient (apiKey , etherscanUrl , rate .NewLimiter (rate .Limit (1 ), 1 ))
41
46
@@ -94,7 +99,8 @@ func VerifyCLI(cliCtx *cli.Context) error {
94
99
}
95
100
l .Info ("Downloaded artifacts" , "path" , artifactsFS )
96
101
97
- v , err := NewVerifier (etherscanAPIKey , l1ChainId , artifactsFS , l , l1Client )
102
+ etherscanUrl := cliCtx .String (deployer .EtherscanUrlFlagName )
103
+ v , err := NewVerifier (etherscanAPIKey , l1ChainId , artifactsFS , l , l1Client , etherscanUrl )
98
104
if err != nil {
99
105
return fmt .Errorf ("failed to create verifier: %w" , err )
100
106
}
0 commit comments