GithubHelp home page GithubHelp logo

forge-safe's Introduction

forge-safe: Gnosis Safe batch builder

Forge Safe lets Forge users build Gnosis Safe batch transactions using Forge scripting in Solidity. Forge Safe builds a collection of encoded transactions, then sends them to the Gnosis Safe Transaction Service uses surl.

The goal of this tool is to allow users to quickly build, validate and version control complex Safe batches as code.

Inspired by ape-safe and Olymsig

Supported Chains

Only supports Mainnet, Goerli and Arbitrum currently. If you'd like more to be supported, please make a PR.

The only chains supported by Gnosis Safe API can be found here.

Installation

forge install ind-igo/forge-safe

Usage

Steps:

  1. In your .env file
    • Set CHAIN to the name of the chain your Safe is on
    • Set WALLET_TYPE with LOCAL or LEDGER depending on your wallet
  2. Import BatchScript.sol into your Forge script
  3. Call addToBatch() for each encoded call
  4. After all encoded txs have been added, call executeBatch() with your Safe address and whether to send the transaction
  5. Sign the batch data
  6. ???
  7. Profit
import {BatchScript} from "forge-safe/BatchScript.sol";

...

function run(bool send_) public {
        string memory gm = "gm";
        address greeter = 0x1111;

        bytes memory txn = abi.encodeWithSelector(
            Greeter.greet.selector,
            gm
        );
        addToBatch(greeter, 0, txn);

        executeBatch(safe, send_);
}

forge-safe's People

Contributors

oighty avatar ind-igo avatar hardyjosh avatar rickvm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.