@godzillaba/mutest 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/Dockerfile +117 -0
- package/.devcontainer/devcontainer.json +62 -0
- package/.devcontainer/init-firewall.sh +118 -0
- package/.github/workflows/test.yml +38 -0
- package/.gitmodules +3 -0
- package/CLAUDE.md +39 -0
- package/README.md +33 -0
- package/foundry.lock +8 -0
- package/foundry.toml +6 -0
- package/index.ts +97 -0
- package/lib/forge-std/.gitattributes +1 -0
- package/lib/forge-std/.github/CODEOWNERS +1 -0
- package/lib/forge-std/.github/dependabot.yml +6 -0
- package/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/lib/forge-std/CONTRIBUTING.md +193 -0
- package/lib/forge-std/LICENSE-APACHE +203 -0
- package/lib/forge-std/LICENSE-MIT +25 -0
- package/lib/forge-std/README.md +314 -0
- package/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/lib/forge-std/foundry.toml +18 -0
- package/lib/forge-std/package.json +16 -0
- package/lib/forge-std/scripts/vm.py +636 -0
- package/lib/forge-std/src/Base.sol +48 -0
- package/lib/forge-std/src/Config.sol +60 -0
- package/lib/forge-std/src/LibVariable.sol +477 -0
- package/lib/forge-std/src/Script.sol +28 -0
- package/lib/forge-std/src/StdAssertions.sol +779 -0
- package/lib/forge-std/src/StdChains.sol +303 -0
- package/lib/forge-std/src/StdCheats.sol +825 -0
- package/lib/forge-std/src/StdConfig.sol +632 -0
- package/lib/forge-std/src/StdConstants.sol +30 -0
- package/lib/forge-std/src/StdError.sol +15 -0
- package/lib/forge-std/src/StdInvariant.sol +140 -0
- package/lib/forge-std/src/StdJson.sol +275 -0
- package/lib/forge-std/src/StdMath.sol +47 -0
- package/lib/forge-std/src/StdStorage.sol +475 -0
- package/lib/forge-std/src/StdStyle.sol +333 -0
- package/lib/forge-std/src/StdToml.sol +275 -0
- package/lib/forge-std/src/StdUtils.sol +200 -0
- package/lib/forge-std/src/Test.sol +32 -0
- package/lib/forge-std/src/Vm.sol +2533 -0
- package/lib/forge-std/src/console.sol +1551 -0
- package/lib/forge-std/src/console2.sol +4 -0
- package/lib/forge-std/src/interfaces/IERC1155.sol +105 -0
- package/lib/forge-std/src/interfaces/IERC165.sol +12 -0
- package/lib/forge-std/src/interfaces/IERC20.sol +43 -0
- package/lib/forge-std/src/interfaces/IERC4626.sol +190 -0
- package/lib/forge-std/src/interfaces/IERC6909.sol +72 -0
- package/lib/forge-std/src/interfaces/IERC721.sol +164 -0
- package/lib/forge-std/src/interfaces/IERC7540.sol +144 -0
- package/lib/forge-std/src/interfaces/IERC7575.sol +241 -0
- package/lib/forge-std/src/interfaces/IMulticall3.sol +68 -0
- package/lib/forge-std/src/safeconsole.sol +13248 -0
- package/lib/forge-std/test/CommonBase.t.sol +44 -0
- package/lib/forge-std/test/Config.t.sol +381 -0
- package/lib/forge-std/test/LibVariable.t.sol +452 -0
- package/lib/forge-std/test/StdAssertions.t.sol +141 -0
- package/lib/forge-std/test/StdChains.t.sol +227 -0
- package/lib/forge-std/test/StdCheats.t.sol +638 -0
- package/lib/forge-std/test/StdConstants.t.sol +38 -0
- package/lib/forge-std/test/StdError.t.sol +119 -0
- package/lib/forge-std/test/StdJson.t.sol +49 -0
- package/lib/forge-std/test/StdMath.t.sol +202 -0
- package/lib/forge-std/test/StdStorage.t.sol +485 -0
- package/lib/forge-std/test/StdStyle.t.sol +110 -0
- package/lib/forge-std/test/StdToml.t.sol +49 -0
- package/lib/forge-std/test/StdUtils.t.sol +342 -0
- package/lib/forge-std/test/Vm.t.sol +18 -0
- package/lib/forge-std/test/compilation/CompilationScript.sol +8 -0
- package/lib/forge-std/test/compilation/CompilationScriptBase.sol +8 -0
- package/lib/forge-std/test/compilation/CompilationTest.sol +8 -0
- package/lib/forge-std/test/compilation/CompilationTestBase.sol +8 -0
- package/lib/forge-std/test/fixtures/broadcast.log.json +187 -0
- package/lib/forge-std/test/fixtures/config.toml +81 -0
- package/lib/forge-std/test/fixtures/test.json +8 -0
- package/lib/forge-std/test/fixtures/test.toml +6 -0
- package/package.json +10 -0
- package/script/Counter.s.sol +19 -0
- package/src/Counter.sol +14 -0
- package/test/Counter.t.sol +24 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.8.13 <0.9.0;
|
|
3
|
+
|
|
4
|
+
import {VmSafe} from "./Vm.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* StdChains provides information about EVM compatible chains that can be used in scripts/tests.
|
|
8
|
+
* For each chain, the chain's name, chain ID, and a default RPC URL are provided. Chains are
|
|
9
|
+
* identified by their alias, which is the same as the alias in the `[rpc_endpoints]` section of
|
|
10
|
+
* the `foundry.toml` file. For best UX, ensure the alias in the `foundry.toml` file matches the
|
|
11
|
+
* alias used in this contract, which can be found as the first argument to the
|
|
12
|
+
* `setChainWithDefaultRpcUrl` call in the `initializeStdChains` function.
|
|
13
|
+
*
|
|
14
|
+
* There are two main ways to use this contract:
|
|
15
|
+
* 1. Set a chain with `setChain(string memory chainAlias, ChainData memory chain)` or
|
|
16
|
+
* `setChain(string memory chainAlias, Chain memory chain)`
|
|
17
|
+
* 2. Get a chain with `getChain(string memory chainAlias)` or `getChain(uint256 chainId)`.
|
|
18
|
+
*
|
|
19
|
+
* The first time either of those are used, chains are initialized with the default set of RPC URLs.
|
|
20
|
+
* This is done in `initializeStdChains`, which uses `setChainWithDefaultRpcUrl`. Defaults are recorded in
|
|
21
|
+
* `defaultRpcUrls`.
|
|
22
|
+
*
|
|
23
|
+
* The `setChain` function is straightforward, and it simply saves off the given chain data.
|
|
24
|
+
*
|
|
25
|
+
* The `getChain` methods use `getChainWithUpdatedRpcUrl` to return a chain. For example, let's say
|
|
26
|
+
* we want to retrieve the RPC URL for `mainnet`:
|
|
27
|
+
* - If you have specified data with `setChain`, it will return that.
|
|
28
|
+
* - If you have configured a mainnet RPC URL in `foundry.toml`, it will return the URL, provided it
|
|
29
|
+
* is valid (e.g. a URL is specified, or an environment variable is given and exists).
|
|
30
|
+
* - If neither of the above conditions is met, the default data is returned.
|
|
31
|
+
*
|
|
32
|
+
* Summarizing the above, the prioritization hierarchy is `setChain` -> `foundry.toml` -> environment variable -> defaults.
|
|
33
|
+
*/
|
|
34
|
+
abstract contract StdChains {
|
|
35
|
+
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
|
|
36
|
+
|
|
37
|
+
bool private stdChainsInitialized;
|
|
38
|
+
|
|
39
|
+
struct ChainData {
|
|
40
|
+
string name;
|
|
41
|
+
uint256 chainId;
|
|
42
|
+
string rpcUrl;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
struct Chain {
|
|
46
|
+
// The chain name.
|
|
47
|
+
string name;
|
|
48
|
+
// The chain's Chain ID.
|
|
49
|
+
uint256 chainId;
|
|
50
|
+
// The chain's alias. (i.e. what gets specified in `foundry.toml`).
|
|
51
|
+
string chainAlias;
|
|
52
|
+
// A default RPC endpoint for this chain.
|
|
53
|
+
// NOTE: This default RPC URL is included for convenience to facilitate quick tests and
|
|
54
|
+
// experimentation. Do not use this RPC URL for production test suites, CI, or other heavy
|
|
55
|
+
// usage as you will be throttled and this is a disservice to others who need this endpoint.
|
|
56
|
+
string rpcUrl;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Maps from the chain's alias (matching the alias in the `foundry.toml` file) to chain data.
|
|
60
|
+
mapping(string => Chain) private chains;
|
|
61
|
+
// Maps from the chain's alias to its default RPC URL.
|
|
62
|
+
mapping(string => string) private defaultRpcUrls;
|
|
63
|
+
// Maps from a chain ID to its alias.
|
|
64
|
+
mapping(uint256 => string) private idToAlias;
|
|
65
|
+
|
|
66
|
+
bool private fallbackToDefaultRpcUrls = true;
|
|
67
|
+
|
|
68
|
+
// The RPC URL will be fetched from config or defaultRpcUrls if possible.
|
|
69
|
+
function getChain(string memory chainAlias) internal virtual returns (Chain memory chain) {
|
|
70
|
+
require(bytes(chainAlias).length != 0, "StdChains getChain(string): Chain alias cannot be the empty string.");
|
|
71
|
+
|
|
72
|
+
initializeStdChains();
|
|
73
|
+
chain = chains[chainAlias];
|
|
74
|
+
require(
|
|
75
|
+
chain.chainId != 0,
|
|
76
|
+
string(abi.encodePacked("StdChains getChain(string): Chain with alias \"", chainAlias, "\" not found."))
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
chain = getChainWithUpdatedRpcUrl(chainAlias, chain);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function getChain(uint256 chainId) internal virtual returns (Chain memory chain) {
|
|
83
|
+
require(chainId != 0, "StdChains getChain(uint256): Chain ID cannot be 0.");
|
|
84
|
+
initializeStdChains();
|
|
85
|
+
string memory chainAlias = idToAlias[chainId];
|
|
86
|
+
|
|
87
|
+
chain = chains[chainAlias];
|
|
88
|
+
|
|
89
|
+
require(
|
|
90
|
+
chain.chainId != 0,
|
|
91
|
+
string(abi.encodePacked("StdChains getChain(uint256): Chain with ID ", vm.toString(chainId), " not found."))
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
chain = getChainWithUpdatedRpcUrl(chainAlias, chain);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// set chain info, with priority to argument's rpcUrl field.
|
|
98
|
+
function setChain(string memory chainAlias, ChainData memory chain) internal virtual {
|
|
99
|
+
require(
|
|
100
|
+
bytes(chainAlias).length != 0,
|
|
101
|
+
"StdChains setChain(string,ChainData): Chain alias cannot be the empty string."
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
require(chain.chainId != 0, "StdChains setChain(string,ChainData): Chain ID cannot be 0.");
|
|
105
|
+
|
|
106
|
+
initializeStdChains();
|
|
107
|
+
string memory foundAlias = idToAlias[chain.chainId];
|
|
108
|
+
|
|
109
|
+
require(
|
|
110
|
+
bytes(foundAlias).length == 0 || keccak256(bytes(foundAlias)) == keccak256(bytes(chainAlias)),
|
|
111
|
+
string(
|
|
112
|
+
abi.encodePacked(
|
|
113
|
+
"StdChains setChain(string,ChainData): Chain ID ",
|
|
114
|
+
vm.toString(chain.chainId),
|
|
115
|
+
" already used by \"",
|
|
116
|
+
foundAlias,
|
|
117
|
+
"\"."
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
uint256 oldChainId = chains[chainAlias].chainId;
|
|
123
|
+
delete idToAlias[oldChainId];
|
|
124
|
+
|
|
125
|
+
chains[chainAlias] =
|
|
126
|
+
Chain({name: chain.name, chainId: chain.chainId, chainAlias: chainAlias, rpcUrl: chain.rpcUrl});
|
|
127
|
+
idToAlias[chain.chainId] = chainAlias;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// set chain info, with priority to argument's rpcUrl field.
|
|
131
|
+
function setChain(string memory chainAlias, Chain memory chain) internal virtual {
|
|
132
|
+
setChain(chainAlias, ChainData({name: chain.name, chainId: chain.chainId, rpcUrl: chain.rpcUrl}));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function _toUpper(string memory str) private pure returns (string memory) {
|
|
136
|
+
bytes memory strb = bytes(str);
|
|
137
|
+
bytes memory copy = new bytes(strb.length);
|
|
138
|
+
for (uint256 i = 0; i < strb.length; i++) {
|
|
139
|
+
bytes1 b = strb[i];
|
|
140
|
+
if (b >= 0x61 && b <= 0x7A) {
|
|
141
|
+
copy[i] = bytes1(uint8(b) - 32);
|
|
142
|
+
} else {
|
|
143
|
+
copy[i] = b;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return string(copy);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// lookup rpcUrl, in descending order of priority:
|
|
150
|
+
// current -> config (foundry.toml) -> environment variable -> default
|
|
151
|
+
function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain)
|
|
152
|
+
private
|
|
153
|
+
view
|
|
154
|
+
returns (Chain memory)
|
|
155
|
+
{
|
|
156
|
+
if (bytes(chain.rpcUrl).length == 0) {
|
|
157
|
+
try vm.rpcUrl(chainAlias) returns (string memory configRpcUrl) {
|
|
158
|
+
chain.rpcUrl = configRpcUrl;
|
|
159
|
+
} catch (bytes memory err) {
|
|
160
|
+
string memory envName = string(abi.encodePacked(_toUpper(chainAlias), "_RPC_URL"));
|
|
161
|
+
if (fallbackToDefaultRpcUrls) {
|
|
162
|
+
chain.rpcUrl = vm.envOr(envName, defaultRpcUrls[chainAlias]);
|
|
163
|
+
} else {
|
|
164
|
+
chain.rpcUrl = vm.envString(envName);
|
|
165
|
+
}
|
|
166
|
+
// Distinguish 'not found' from 'cannot read'
|
|
167
|
+
// The upstream error thrown by forge for failing cheats changed so we check both the old and new versions
|
|
168
|
+
bytes memory oldNotFoundError =
|
|
169
|
+
abi.encodeWithSignature("CheatCodeError", string(abi.encodePacked("invalid rpc url ", chainAlias)));
|
|
170
|
+
bytes memory newNotFoundError = abi.encodeWithSignature(
|
|
171
|
+
"CheatcodeError(string)", string(abi.encodePacked("invalid rpc url: ", chainAlias))
|
|
172
|
+
);
|
|
173
|
+
bytes32 errHash = keccak256(err);
|
|
174
|
+
if (
|
|
175
|
+
(errHash != keccak256(oldNotFoundError) && errHash != keccak256(newNotFoundError))
|
|
176
|
+
|| bytes(chain.rpcUrl).length == 0
|
|
177
|
+
) {
|
|
178
|
+
assembly ("memory-safe") {
|
|
179
|
+
revert(add(32, err), mload(err))
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return chain;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function setFallbackToDefaultRpcUrls(bool useDefault) internal {
|
|
188
|
+
fallbackToDefaultRpcUrls = useDefault;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function initializeStdChains() private {
|
|
192
|
+
if (stdChainsInitialized) return;
|
|
193
|
+
|
|
194
|
+
stdChainsInitialized = true;
|
|
195
|
+
|
|
196
|
+
// If adding an RPC here, make sure to test the default RPC URL in `test_Rpcs` in `StdChains.t.sol`
|
|
197
|
+
setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545"));
|
|
198
|
+
setChainWithDefaultRpcUrl("mainnet", ChainData("Mainnet", 1, "https://eth.llamarpc.com"));
|
|
199
|
+
setChainWithDefaultRpcUrl(
|
|
200
|
+
"sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001")
|
|
201
|
+
);
|
|
202
|
+
setChainWithDefaultRpcUrl("holesky", ChainData("Holesky", 17000, "https://rpc.holesky.ethpandaops.io"));
|
|
203
|
+
setChainWithDefaultRpcUrl("hoodi", ChainData("Hoodi", 560048, "https://rpc.hoodi.ethpandaops.io"));
|
|
204
|
+
setChainWithDefaultRpcUrl("optimism", ChainData("Optimism", 10, "https://mainnet.optimism.io"));
|
|
205
|
+
setChainWithDefaultRpcUrl(
|
|
206
|
+
"optimism_sepolia", ChainData("Optimism Sepolia", 11155420, "https://sepolia.optimism.io")
|
|
207
|
+
);
|
|
208
|
+
setChainWithDefaultRpcUrl("arbitrum_one", ChainData("Arbitrum One", 42161, "https://arb1.arbitrum.io/rpc"));
|
|
209
|
+
setChainWithDefaultRpcUrl(
|
|
210
|
+
"arbitrum_one_sepolia", ChainData("Arbitrum One Sepolia", 421614, "https://sepolia-rollup.arbitrum.io/rpc")
|
|
211
|
+
);
|
|
212
|
+
setChainWithDefaultRpcUrl("arbitrum_nova", ChainData("Arbitrum Nova", 42170, "https://nova.arbitrum.io/rpc"));
|
|
213
|
+
setChainWithDefaultRpcUrl("polygon", ChainData("Polygon", 137, "https://polygon-rpc.com"));
|
|
214
|
+
setChainWithDefaultRpcUrl(
|
|
215
|
+
"polygon_amoy", ChainData("Polygon Amoy", 80002, "https://rpc-amoy.polygon.technology")
|
|
216
|
+
);
|
|
217
|
+
setChainWithDefaultRpcUrl("avalanche", ChainData("Avalanche", 43114, "https://api.avax.network/ext/bc/C/rpc"));
|
|
218
|
+
setChainWithDefaultRpcUrl(
|
|
219
|
+
"avalanche_fuji", ChainData("Avalanche Fuji", 43113, "https://api.avax-test.network/ext/bc/C/rpc")
|
|
220
|
+
);
|
|
221
|
+
setChainWithDefaultRpcUrl(
|
|
222
|
+
"bnb_smart_chain", ChainData("BNB Smart Chain", 56, "https://bsc-dataseed1.binance.org")
|
|
223
|
+
);
|
|
224
|
+
setChainWithDefaultRpcUrl(
|
|
225
|
+
"bnb_smart_chain_testnet",
|
|
226
|
+
ChainData("BNB Smart Chain Testnet", 97, "https://rpc.ankr.com/bsc_testnet_chapel")
|
|
227
|
+
);
|
|
228
|
+
setChainWithDefaultRpcUrl("gnosis_chain", ChainData("Gnosis Chain", 100, "https://rpc.gnosischain.com"));
|
|
229
|
+
setChainWithDefaultRpcUrl("moonbeam", ChainData("Moonbeam", 1284, "https://rpc.api.moonbeam.network"));
|
|
230
|
+
setChainWithDefaultRpcUrl(
|
|
231
|
+
"moonriver", ChainData("Moonriver", 1285, "https://rpc.api.moonriver.moonbeam.network")
|
|
232
|
+
);
|
|
233
|
+
setChainWithDefaultRpcUrl("moonbase", ChainData("Moonbase", 1287, "https://rpc.testnet.moonbeam.network"));
|
|
234
|
+
setChainWithDefaultRpcUrl("base_sepolia", ChainData("Base Sepolia", 84532, "https://sepolia.base.org"));
|
|
235
|
+
setChainWithDefaultRpcUrl("base", ChainData("Base", 8453, "https://mainnet.base.org"));
|
|
236
|
+
setChainWithDefaultRpcUrl("blast_sepolia", ChainData("Blast Sepolia", 168587773, "https://sepolia.blast.io"));
|
|
237
|
+
setChainWithDefaultRpcUrl("blast", ChainData("Blast", 81457, "https://rpc.blast.io"));
|
|
238
|
+
setChainWithDefaultRpcUrl("fantom_opera", ChainData("Fantom Opera", 250, "https://rpc.ankr.com/fantom/"));
|
|
239
|
+
setChainWithDefaultRpcUrl(
|
|
240
|
+
"fantom_opera_testnet", ChainData("Fantom Opera Testnet", 4002, "https://rpc.ankr.com/fantom_testnet/")
|
|
241
|
+
);
|
|
242
|
+
setChainWithDefaultRpcUrl("fraxtal", ChainData("Fraxtal", 252, "https://rpc.frax.com"));
|
|
243
|
+
setChainWithDefaultRpcUrl("fraxtal_testnet", ChainData("Fraxtal Testnet", 2522, "https://rpc.testnet.frax.com"));
|
|
244
|
+
setChainWithDefaultRpcUrl(
|
|
245
|
+
"berachain_bartio_testnet", ChainData("Berachain bArtio Testnet", 80084, "https://bartio.rpc.berachain.com")
|
|
246
|
+
);
|
|
247
|
+
setChainWithDefaultRpcUrl("flare", ChainData("Flare", 14, "https://flare-api.flare.network/ext/C/rpc"));
|
|
248
|
+
setChainWithDefaultRpcUrl(
|
|
249
|
+
"flare_coston2", ChainData("Flare Coston2", 114, "https://coston2-api.flare.network/ext/C/rpc")
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
setChainWithDefaultRpcUrl("ink", ChainData("Ink", 57073, "https://rpc-gel.inkonchain.com"));
|
|
253
|
+
setChainWithDefaultRpcUrl(
|
|
254
|
+
"ink_sepolia", ChainData("Ink Sepolia", 763373, "https://rpc-gel-sepolia.inkonchain.com")
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
setChainWithDefaultRpcUrl("mode", ChainData("Mode", 34443, "https://mode.drpc.org"));
|
|
258
|
+
setChainWithDefaultRpcUrl("mode_sepolia", ChainData("Mode Sepolia", 919, "https://sepolia.mode.network"));
|
|
259
|
+
|
|
260
|
+
setChainWithDefaultRpcUrl("zora", ChainData("Zora", 7777777, "https://zora.drpc.org"));
|
|
261
|
+
setChainWithDefaultRpcUrl(
|
|
262
|
+
"zora_sepolia", ChainData("Zora Sepolia", 999999999, "https://sepolia.rpc.zora.energy")
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
setChainWithDefaultRpcUrl("race", ChainData("Race", 6805, "https://racemainnet.io"));
|
|
266
|
+
setChainWithDefaultRpcUrl("race_sepolia", ChainData("Race Sepolia", 6806, "https://racemainnet.io"));
|
|
267
|
+
|
|
268
|
+
setChainWithDefaultRpcUrl("metal", ChainData("Metal", 1750, "https://metall2.drpc.org"));
|
|
269
|
+
setChainWithDefaultRpcUrl("metal_sepolia", ChainData("Metal Sepolia", 1740, "https://testnet.rpc.metall2.com"));
|
|
270
|
+
|
|
271
|
+
setChainWithDefaultRpcUrl("binary", ChainData("Binary", 624, "https://rpc.zero.thebinaryholdings.com"));
|
|
272
|
+
setChainWithDefaultRpcUrl(
|
|
273
|
+
"binary_sepolia", ChainData("Binary Sepolia", 625, "https://rpc.zero.thebinaryholdings.com")
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
setChainWithDefaultRpcUrl("orderly", ChainData("Orderly", 291, "https://rpc.orderly.network"));
|
|
277
|
+
setChainWithDefaultRpcUrl(
|
|
278
|
+
"orderly_sepolia", ChainData("Orderly Sepolia", 4460, "https://testnet-rpc.orderly.org")
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
setChainWithDefaultRpcUrl("unichain", ChainData("Unichain", 130, "https://mainnet.unichain.org"));
|
|
282
|
+
setChainWithDefaultRpcUrl(
|
|
283
|
+
"unichain_sepolia", ChainData("Unichain Sepolia", 1301, "https://sepolia.unichain.org")
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
setChainWithDefaultRpcUrl("tempo", ChainData("Tempo", 4217, "https://rpc.mainnet.tempo.xyz"));
|
|
287
|
+
setChainWithDefaultRpcUrl(
|
|
288
|
+
"tempo_moderato", ChainData("Tempo Moderato", 42431, "https://rpc.moderato.tempo.xyz")
|
|
289
|
+
);
|
|
290
|
+
setChainWithDefaultRpcUrl(
|
|
291
|
+
"tempo_andantino", ChainData("Tempo Andantino", 42429, "https://rpc.testnet.tempo.xyz")
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// set chain info, with priority to chainAlias' rpc url in foundry.toml
|
|
296
|
+
function setChainWithDefaultRpcUrl(string memory chainAlias, ChainData memory chain) private {
|
|
297
|
+
string memory rpcUrl = chain.rpcUrl;
|
|
298
|
+
defaultRpcUrls[chainAlias] = rpcUrl;
|
|
299
|
+
chain.rpcUrl = "";
|
|
300
|
+
setChain(chainAlias, chain);
|
|
301
|
+
chain.rpcUrl = rpcUrl; // restore argument
|
|
302
|
+
}
|
|
303
|
+
}
|