{"id":22873965,"url":"https://github.com/angleprotocol/safe-multisig","last_synced_at":"2025-09-10T12:39:55.642Z","repository":{"id":202629344,"uuid":"707144068","full_name":"AngleProtocol/safe-multisig","owner":"AngleProtocol","description":"Utils to publish transaction create via Foundry on Gnosis Safe","archived":false,"fork":false,"pushed_at":"2023-10-25T10:15:01.000Z","size":5886,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-18T05:54:37.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngleProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-19T10:05:54.000Z","updated_at":"2023-12-30T05:32:17.000Z","dependencies_parsed_at":"2023-10-25T11:49:33.377Z","dependency_job_id":null,"html_url":"https://github.com/AngleProtocol/safe-multisig","commit_stats":null,"previous_names":["angleprotocol/safe-multisig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fsafe-multisig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fsafe-multisig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fsafe-multisig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fsafe-multisig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngleProtocol","download_url":"https://codeload.github.com/AngleProtocol/safe-multisig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229556372,"owners_count":18091750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T14:32:08.369Z","updated_at":"2024-12-13T14:32:08.919Z","avatar_url":"https://github.com/AngleProtocol.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Safe Multisig Boilerplate\n\nStreamline your [Safe multisig](https://safe.global/) transaction maintenance using [Foundry](https://github.com/foundry-rs/foundry).\n\n## Table of Contents\n\n- [Why a multisig management repo?](#why-a-multisig-management-repo)\n- [Usage](#usage)\n  - [Overview](#overview)\n  - [Add Delegate](#add-delegate)\n  - [Propose a transaction](#propose-a-transaction)\n  - [Verify a transaction](#verify-a-transaction)\n  - [Push Transaction to Gnosis](#push-a-transaction-to-gnosis)\n- [Examples](#examples)\n- [Getting Started](#getting-started)\n  - [Install Foundry](#install-foundry)\n  - [Install Packages](#install-packages)\n  - [Setup Environment](#setup-environment)\n\n## Why a multisig management repo?\n\nMaintenance of smart contracts system through [Safe](https://safe.global/) multisigs can be cumbersome, especially if relying on the Safe interface to do this.\n\nYou may end up doing tens or hundreds of transactions with the same logic but different parameters, or craft complex transactions with the `Transaction Builder` which can be error prone and fastidious.\n\nThis repo leverages both [Safe](https://safe.global/) and [Foundry](https://github.com/foundry-rs/foundry) to make the life of protocol contributors, institutional safe owner or personal safe owners easier when it comes to dealing with multisig interaction. This applies to any type of use case whether it is protocol maintenance, streaming funds, launching new features and more.\n\n## Usage\n\n### Overview\n\nTo manage a multisig with this repo:\n\n1. Initially (done only once) set up a delegate for your organization to propose transactions on the Safe interface.\n2. For any new transaction, use a Foundry script to create (even a bundle of actions). Test this via Foundry, and then push it with the delegate address to Safe.\n3. Multisig owners will then sign the transaction to execute it.\n\n### Add Delegate\n\nThe [addDelegate.py](./addDelegate.py) file helps to add a delegate to a Gnosis Safe.\n\nA delegate is an address that can propose transactions to a Gnosis Safe, it does not have any onchain right. The delegate address just has the right to mess up with the portal of waiting transactions associated to a safe. There are some other utility functions in this file.\n\nThe reason for introducing a delegate is that the address of the delegate can be unsafe and its private key can be stored in clear (because it never directly interacts with the blockchain).\n\n### Propose a transaction\n\n#### Build your script\n\nTo propose a transaction through the Gnosis Safe UI, what you first need is a script corresponding to the transaction you want to push.\n\nFor example: `scripts/foundry/Example.s.sol` contains an example of a script designed to build the transaction to pause an ERC20 token that is pausable.\n\nYou can craft any script within the [folder](scripts/foundry/) using Foundry\n\nIn any case, you will need the script to compile before running it and so if calling functions of other contracts, you'll most likely need to provide the Solidity interfaces of the contracts that you'll be calling from your script.\n\nOnce your script is ready, you can then prepare to submit it to your Gnosis Safe so your signers just have to sign it.\n\n#### Fork\n\nYour script may need to make on chain calls, so you should run beforehand:\n\n```bash\nyarn fork:{CHAIN_NAME}\n```\n\nDon't forget to update the scripts in [./package.json](./package.json), if you are building on other chains.\n\n#### Build the transaction\n\nYou can run a script with:\n\n```bash\nyarn script:fork \u003cscript-path\u003e\n```\n\nFor example:\n\n```bash\nyarn script:fork scripts/foundry/Example.s.sol\n```\n\nThis will generate an object in [scripts/foundry/transaction.json](scripts/foundry/transaction.json) with properties: chainId, data, operation, to, value. These are required to pass a transaction on Gnosis Safe.\n\n### Verify a transaction\n\nYou may want to test the validity of the transaction you submit to your multisig and verify the expected outcome.\n\nTo do this, after generating the object via [Propose a Transaction](#propose-a-transaction), you can run:\n\n```bash\nyarn test \u003ctest-contract-name\u003e\n```\n\nE.g.:\n\n```bash\nyarn test ExampleTest\n```\n\n### Push a transaction to Gnosis\n\nOnce your tests are satisfied, you can push the transaction to your Safe with:\n\n```bash\nyarn submit:foundry\n```\n\nEnsure your [.env](./.env) is correctly set up, and you have the correct values and addresses in [scripts/foundry/transaction.json](scripts/foundry/transaction.json)\n\n## Examples\n\nThis repository provides a general-purpose boilerplate. For specific implementations, refer to [Angle Multisig](https://github.com/AngleProtocol/angle-multisig) repo which has examples of how to set interest rates across all Angle collateral assets or modify the fee structure of the PSM (aka Transmuter).\n\n## Getting started\n\n### Install Foundry\n\nIf you don't have Foundry:\n\n```bash\ncurl -L https://foundry.paradigm.xyz | bash\n\nsource /root/.zshrc\n# or, if you're under bash: source /root/.bashrc\n\nfoundryup\n```\n\nTo install the standard library:\n\n```bash\nforge install foundry-rs/forge-std\n```\n\nTo update libraries:\n\n```bash\nforge update\n```\n\n### Install packages\n\nYou can install all dependencies by running\n\n```bash\nyarn\nforge i\n```\n\nInstall python dependencies (see [.requirements.txt](./requirements.txt)):\n\n## Setup environment\n\nYou must provide some necessary environment variables (see [.env.example](./.env.example)):\n\n```env\nSAFE = \"\"\nCHAIN_ID = \"\"\nDELEGATE_ADDRESS = \"\"\nDELEGATOR_ADDRESS = \"\"\nDELEGATOR_PRIVATE_KEY = \"\"\nPRIVATE_KEY = \"\"\n\nETH_NODE_URI_MAINNET=\"\"\nETH_NODE_URI_POLYGON=\"\"\nETH_NODE_URI_OPTIMISM=\"\"\nETH_NODE_URI_ARBITRUM=\"\"\nETH_NODE_URI_AVALANCHE=\"\"\n```\n\nFor more chains support add the necessary URIs for your specific chains.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangleprotocol%2Fsafe-multisig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangleprotocol%2Fsafe-multisig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangleprotocol%2Fsafe-multisig/lists"}