Send batch of transactions from forge script to Safe Transaction Service. Supports Trezor, Ledger or Frame (for pk/mnemonic and it also supports Trezor/Ledger).
Chains: Mainnet, Sepolia, Optimism, Arbitrum, BSC, Gnosis, Polygon, Polygon zkEVM, zkSync, Celo, Aurora
- foundry: required, obvious
curl -L https://foundry.paradigm.xyz | bash- bun: required, for ffi-scripts
curl -fsSL https://bun.sh/install | bash- frame: optional, required for pk/mnemonic
- just: optional, buut better just use it
forge install && cp .env.example .env- SIGNER_TYPE: 0 = Trezor, 1 = Frame, 2 = Ledger
- SAFE_ADDRESS: Address of your safe.
- SAFE_NETWORK: Matches what is configured in foundry.toml eg. "arbitrum".
- SAFE_CHAIN_ID: Matches the above network.
- MNEMONIC_PATH: Derivation path for directly using trezor/ledger.
- MNEMONIC: Optional, some other wallet (use with eg. getAddr(0), see: SafeTxBase.sol)
This thing relies on unique function naming as it uses --sig "myFunc()" - do not use the default function run().
Only transactions broadcasted by SAFE_ADDRESS are included in the batch. If the batch depends on other transactions they need to be broadcasted separately.
Simulates and signs a batch without proposing:
just safe-dry Send safeTxYou can later propose it using the output file written in temp/sign, eg:
just safe-file 1717240045-42161-signed-batchUse current nonce
just safe-run Send safeTxor
forge script Send --sig "safeTx()" && forge script SafeScript --sig "sendBatch(string)" safeTx --ffi -vvvUse custom nonce
just safe-run-nonce Send safeTx 111or
forge script Send --sig "safeTx()" && forge script SafeScript --sig "sendBatch(string,uint256)" safeTx 111 --ffi -vvvjust safe-del 0xSAFE_TX_HASHor
bun utils/ffi.ts deleteBatch 0xSAFE_TX_HASH- Look into
utils/ffi.tsfor other available commands usingbun utils/ffi.ts command ...args