Skip to content

Recon-Fuzz/safe-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

safe-utils

Interact with the Safe API from Foundry scripts.

Installation

forge install Recon-Fuzz/safe-utils

Usage

1. Import the library

import {Safe} from "safe-utils/Safe.sol";

2. Initialize the client

Build the client by passing your safe address.

using Safe for *;

Safe.Client safe;

function setUp() public {
  safe.initialize(safeAddress);
}

3. Propose transactions

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");

Requirements

  • Foundry with FFI enabled:
    • Pass --ffi to your commands (e.g. forge test --ffi)
    • Or set ffi = true in your foundry.toml
[profile.default]
ffi = true
  • All Recon-Fuzz/solidity-http dependencies

Disclaimer

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

About

Interact with the Safe API from Foundry scripts

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •