From 97993c955fd267ea146ee4b651ab7731ff8ef31f Mon Sep 17 00:00:00 2001 From: Jack Chuma Date: Fri, 21 Nov 2025 10:21:39 -0500 Subject: [PATCH] add readme to script/universal dir --- script/universal/README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 script/universal/README.md diff --git a/script/universal/README.md b/script/universal/README.md new file mode 100644 index 0000000..a67e8a0 --- /dev/null +++ b/script/universal/README.md @@ -0,0 +1,36 @@ +# Universal Scripts + +This directory contains a collection of utility scripts and libraries used in Base smart contract operations tasks. These utilities are designed to simplify the process of creating, simulating, signing, and executing transactions, particularly those involving Gnosis Safe multisigs. + +For the actual operations tasks and usage examples, please refer to the [contract-deployments repository](https://github.com/base/contract-deployments). + +## Key Files + +### `MultisigScript.sol` + +This is the core script for building Forge scripts that interact with Gnosis Safes. It supports: + +- **Nested Multisigs**: Handles arbitrary depths of nested Safes (Safes owned by other Safes). +- **Workflows**: Provides standard functions for `sign` (generating signatures), `approve` (onchain approval for nested Safes), `simulate` (dry-run with state overrides), and `run` (execution). +- **Simulation**: Integrates with `Simulation.sol` to provide detailed simulation links and state diffs. + +### `Simulation.sol` + +A library for simulating multisig transactions with state overrides. It is particularly useful for: + +- Generating Tenderly simulation links. +- Overriding contract storage (e.g., modifying Safe thresholds or nonces) to test execution paths that would otherwise be blocked. + +### `MultisigBuilder.sol` + +_Deprecated_. Use `MultisigScript.sol` instead. This was an earlier version of the multisig tooling. + +### Other Utilities + +- `IGnosisSafe.sol`: Interface definitions for interacting with Gnosis Safe contracts. +- `Signatures.sol`: Helper functions for handling and formatting signatures for Gnosis Safe transactions. +- `StateDiff.sol`: Utilities for capturing and reporting state changes during simulations. + +## Usage + +These scripts are typically imported by specific task scripts in the `contract-deployments` repository. A typical task script inherits from `MultisigScript` and implements the `_buildCalls` method to define the actions to be taken.