You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,52 @@ contract Bar {
221
221
222
222
Provides comprehensive assertion functions for testing, including equality checks (assertEq, assertNotEq), comparisons (assertLt, assertGt, assertLe, assertGe), approximate equality (assertApproxEqAbs, assertApproxEqRel), and boolean assertions (assertTrue, assertFalse). All assertions support multiple data types and optional custom error messages.
223
223
224
+
### StdConfig
225
+
226
+
This is a contract that parses a TOML configuration file and loads its variables into storage, automatically casting them on deployment. It assumes a TOML structure where top-level keys represent chain IDs or aliases. Under each chain key, variables are organized by type in separate sub-tables like `[<chain>.<type>]`, where type must be: `bool`, `address`, `bytes32`, `uint`, `int`, `string`, or `bytes`.
227
+
228
+
#### Example usage
229
+
230
+
```solidity
231
+
232
+
// SPDX-License-Identifier: MIT OR Apache-2.0
233
+
pragma solidity ^0.8.13;
234
+
235
+
import "forge-std/Script.sol";
236
+
import "forge-std/StdConfig.sol";
237
+
238
+
contract MyScript is Script {
239
+
StdConfig config;
240
+
241
+
function run() public {
242
+
// Load config (set writeToFile=true only in scripts to persist changes)
0 commit comments