Skip to content

Commit bc1b812

Browse files
authored
feat: add config checker for multisig/DAO info (#101)
* feat: add checker script for evm multisigs and aragon dao * feat: add solana multisig support to checker script * feat: add docs and update deps for multisig checker - Added `get-multisig-info` script to report owners and thresholds for Gnosis Safe multisigs, Aragon DAO plugins, and Solana Squads. - Updated `.env.example` with new environment variables for multisig addresses. - Included `@sqds/multisig` package in dependencies and updated `package-lock.json`. - Enhanced README with usage instructions for the new script. * fix: trigger ci * feat: enhance multisig checker with Gateway Safe AdminModule support - Added functionality to retrieve and verify the AdminModule information for the Gateway Safe. - Updated README to include details about the new AdminModule environment variable and its usage. - Modified the `get-multisig-info` script to check for enabled modules and validate the AdminModule's configuration. * docs: clarify SOLANA_SQUADS_MULTISIG_ACCOUNT usage in README and .env.example - Updated README to differentiate between the Squads multisig account PDA and the vault ID, providing clear instructions on where to find each. - Enhanced .env.example with additional comments to prevent confusion regarding the multisig account's purpose. - Added notes in the get-multisig-info script to emphasize the distinction and avoid potential errors when retrieving multisig data.
1 parent f553e34 commit bc1b812

5 files changed

Lines changed: 603 additions & 1 deletion

File tree

contracts/chains-config-checker/.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ ZAMA_OFT_GATEWAY="0xcE762c7FDaac795D31a266B9247F8958c159c6d4"
1111
ZAMA_OFT_BSC="0x6907A5986C4950Bdaf2F81828Ec0737ce787519f"
1212
ZAMA_OFT_HYPEREVM="0x43cdd2cCbeB38Eb62fDf54e17aFBabf450ebBB01"
1313

14+
# get-multisig-info.js — Gnosis Safe multisigs & Aragon DAO (mainnet)
15+
ZAMA_SAFE_GATEWAY="0x5f0F86BcEad6976711C9B131bCa5D30E767fe2bE"
16+
ZAMA_SAFE_ADMIN_MODULE_GATEWAY="0x57f866b5E7Fb82Fb812Ed3D3C79cdB35E9e91518"
17+
ZAMA_SAFE_BSC="0xa40939fDe3883D2e7Cd5C32f53AB241804d2779B"
18+
ZAMA_SAFE_HYPEREVM="0x0d66642a5Bc6E32e013f47E08f9db9bDb1268827"
19+
ZAMA_ARAGON_DAO="0xB6D69D5F334d8B97B194617B53c6aB62f8681Ef3"
20+
1421
# Solana
1522
SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
1623
SOLANA_OFT_MINT="4Zp52aF4hZi9fzH19xpbWKYKQvgLyCN67KFbrQDqeTKh"
24+
# NOT the Squads vault id listed in docs/addresses/mainnet/solana.md
25+
# (G9jXsKZ2...TUVf5, the one shown on app.squads.so and used everywhere as
26+
# "the multisig"). This is the separate Squads multisig account PDA that
27+
# stores members and threshold state. Find it on solscan.io under the vault's
28+
# "Multisig" tab, or on app.squads.so under Settings.
29+
SOLANA_SQUADS_MULTISIG_ACCOUNT="HB3boZwyCUmjCo2uPWfVS2WKYmdgGv2XVpRgUaX5CkxC"

contracts/chains-config-checker/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Currently, most useful scripts are:
2929
[*] get-current-pausers
3030
[*] get-token-roles
3131
[*] get-oft-owners
32+
[*] get-multisig-info
3233
```
3334
### getCurrentPausers
3435

@@ -225,3 +226,103 @@ Example output:
225226
Admin, Upgrade Authority, and Delegate should be IDENTICAL on Solana,
226227
and it should be a Squads multisig wallet owned by Zama FB_i operators
227228
```
229+
230+
### getMultisigInfo
231+
232+
Reports owners and thresholds for all deployed multisig wallets (EVM Safes, Aragon DAO plugins, Solana Squads).
233+
234+
#### Usage
235+
236+
```bash
237+
npm run get-multisig-info
238+
```
239+
240+
The script will:
241+
1. Query each configured **Gnosis Safe** (Gateway, BSC, HyperEVM) for `getOwners()` and `getThreshold()`, then cross-check that owners and threshold are identical across all chains.
242+
2. On the **Gateway Safe**, list every enabled module via `getModulesPaginated(SENTINEL, 100)` and verify that the only enabled module is the configured `AdminModule`. The `AdminModule` is also queried for its `ADMIN_ACCOUNT()` and `SAFE_PROXY()`; the latter must match `ZAMA_SAFE_GATEWAY`.
243+
3. Detect active **Aragon DAO plugins** by scanning `Granted`/`Revoked` events for `EXECUTE_PERMISSION` on the DAO, filtering out uninstalled plugins. A sanity check calls `hasPermission()` on-chain to verify the event-derived state.
244+
4. Query the **Solana Squads** multisig account for members and threshold.
245+
246+
**Environment variables:**
247+
248+
| Variable | Description |
249+
|---|---|
250+
| `RPC_GATEWAY` | Gateway RPC endpoint |
251+
| `RPC_BSC` | BSC RPC endpoint |
252+
| `RPC_HYPEREVM` | HyperEVM RPC endpoint |
253+
| `RPC_ETHEREUM` | Ethereum RPC endpoint (for Aragon) |
254+
| `ZAMA_SAFE_GATEWAY` | Safe address on Gateway |
255+
| `ZAMA_SAFE_ADMIN_MODULE_GATEWAY` | AdminModule address enabled on the Gateway Safe |
256+
| `ZAMA_SAFE_BSC` | Safe address on BSC |
257+
| `ZAMA_SAFE_HYPEREVM` | Safe address on HyperEVM |
258+
| `ZAMA_ARAGON_DAO` | Aragon DAO address on Ethereum |
259+
| `SOLANA_RPC_URL` | Solana RPC endpoint |
260+
| `SOLANA_SQUADS_MULTISIG_ACCOUNT` | Squads multisig account PDA** |
261+
262+
> **⚠️ `SOLANA_SQUADS_MULTISIG_ACCOUNT` is NOT the Squads vault ID.**
263+
>
264+
> The address listed as "Squads Multisig" in `docs/addresses/mainnet/solana.md`
265+
> (`G9jXsKZ2...TUVf5`, shown on `app.squads.so` and used everywhere as "the
266+
> multisig") is the vault account: the PDA that holds funds and signs transactions.
267+
>
268+
> `SOLANA_SQUADS_MULTISIG_ACCOUNT` is a different PDA: the Squads **multisig**
269+
> **account** that stores the members list and signing threshold.
270+
>
271+
> Find it on `solscan.io` under the vault's **Multisig** tab, or on
272+
> `app.squads.so` under `Settings`.
273+
274+
#### Example Output
275+
276+
```
277+
=== Safe Multisig Wallets ===
278+
279+
[Gateway]
280+
Safe address : 0x5f0F...2bE
281+
Threshold : 3 of 5
282+
Owners:
283+
1. 0x9b82...9B71
284+
2. 0xf299...fBBE
285+
3. 0x6dd4...5874
286+
4. 0x8edF...8CB8
287+
5. 0x7053...02b3
288+
289+
[BSC]
290+
...
291+
292+
[HyperEVM]
293+
...
294+
295+
All Safe wallets have IDENTICAL owners and threshold (3 of 5)
296+
297+
=== Gateway Safe AdminModule ===
298+
299+
[Gateway AdminModule]
300+
Module address : 0x57f866b5E7Fb82Fb812Ed3D3C79cdB35E9e91518
301+
Admin account : 0x...
302+
Safe proxy : 0x5f0F86BcEad6976711C9B131bCa5D30E767fe2bE
303+
304+
[Gateway Safe enabled modules]
305+
Safe address : 0x5f0F86BcEad6976711C9B131bCa5D30E767fe2bE
306+
Total enabled : 1
307+
1. 0x57f866b5E7Fb82Fb812Ed3D3C79cdB35E9e91518
308+
309+
Only the AdminModule is enabled on the Gateway Safe, and its SAFE_PROXY matches.
310+
311+
=== Aragon DAO Plugins ===
312+
DAO: 0xB6D6...Ef3
313+
...
314+
315+
Detected 2 active plugin address(es):
316+
https://etherscan.io/address/0x...
317+
https://etherscan.io/address/0x...
318+
319+
=== Solana Squads Multisig ===
320+
321+
[Solana Squads]
322+
Multisig account : HB3bo...CkxC
323+
Threshold : 4 of 6
324+
Members:
325+
1. ...
326+
2. ...
327+
...
328+
```

contracts/chains-config-checker/package-lock.json

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/chains-config-checker/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"get-token-roles": "node utils/get-token-roles.js",
99
"get-oft-owners-evm": "node utils/get-oft-owners-evm.js",
1010
"get-oft-owners-solana": "node utils/get-oft-owners-solana.js",
11-
"get-oft-owners": "node utils/get-oft-owners-evm.js && node utils/get-oft-owners-solana.js"
11+
"get-oft-owners": "node utils/get-oft-owners-evm.js && node utils/get-oft-owners-solana.js",
12+
"get-multisig-info": "node utils/get-multisig-info.js"
1213
},
1314
"dependencies": {
1415
"@layerzerolabs/lz-solana-sdk-v2": "^3.0.136",
@@ -18,6 +19,7 @@
1819
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
1920
"@metaplex-foundation/umi-web3js-adapters": "^0.9.2",
2021
"@solana/web3.js": "~1.95.8",
22+
"@sqds/multisig": "^2.1.4",
2123
"dotenv": "^16.0.0",
2224
"ethers": "^6.0.0"
2325
},

0 commit comments

Comments
 (0)