Interact with the Safe API from Foundry scripts.
forge install Recon-Fuzz/safe-utils
import {Safe} from "safe-utils/Safe.sol";
Build the client by passing your safe address.
using Safe for *;
Safe.Client safe;
function setUp() public {
safe.initialize(safeAddress);
}
safe.proposeTransaction(weth, abi.encodeCall(IWETH.withdraw, (0)), sender);
If you are using ledger, make sure to pass the derivation path as the last argument:
safe.proposeTransaction(weth, abi.encodeCall(IWETH.withdraw, (0)), sender, "m/44'/60'/0'/0/0");
- Foundry with FFI enabled:
- Pass
--ffi
to your commands (e.g.forge test --ffi
) - Or set
ffi = true
in yourfoundry.toml
- Pass
[profile.default]
ffi = true
- All
Recon-Fuzz/solidity-http
dependencies
This code is provided "as is" and has not undergone a formal security audit.
Use it at your own risk. The author(s) assume no liability for any damages or losses resulting from the use of this code. It is your responsibility to thoroughly review, test, and validate its security and functionality before deploying or relying on it in any environment.
This is not an official @safe-global library