Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 4a510e7

Browse files
committed
Make chain setup in scripts idempotent
1 parent a8de0c9 commit 4a510e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Chainweb.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ contract Chainweb is CommonBase {
4444
}
4545

4646
function setupChainsForScript() public {
47+
if (_chainForks.length > 0) {
48+
console.log("Chain forks already set up, skipping setup.");
49+
return;
50+
}
4751
console.log("Setting main RPC node for", _chains, "chains");
4852
for (uint256 i = 0; i < _chains; i++) {
4953
if (bytes(_hostUrl).length > 0) {

0 commit comments

Comments
 (0)