{"id":28467971,"url":"https://github.com/apeworx/ape-safe","last_synced_at":"2025-07-01T09:33:42.321Z","repository":{"id":96013849,"uuid":"587807830","full_name":"ApeWorX/ape-safe","owner":"ApeWorX","description":"Safe (Wallet) account plugin for the Ape Framework","archived":false,"fork":false,"pushed_at":"2025-06-25T13:57:57.000Z","size":296,"stargazers_count":18,"open_issues_count":16,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-25T14:51:07.466Z","etag":null,"topics":["ape","apeworx","ethereum","evm","gnosis-safe","python3","safe","safe-wallet"],"latest_commit_sha":null,"homepage":"https://www.apeworx.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"banteg/brownie-safe","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ApeWorX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-11T16:26:53.000Z","updated_at":"2025-06-25T13:57:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d4fc87f-26d8-4193-bf7f-b4baa8399093","html_url":"https://github.com/ApeWorX/ape-safe","commit_stats":null,"previous_names":["apeworx/ape-safe"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ApeWorX/ape-safe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApeWorX%2Fape-safe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApeWorX%2Fape-safe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApeWorX%2Fape-safe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApeWorX%2Fape-safe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApeWorX","download_url":"https://codeload.github.com/ApeWorX/ape-safe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApeWorX%2Fape-safe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261933839,"owners_count":23232545,"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":["ape","apeworx","ethereum","evm","gnosis-safe","python3","safe","safe-wallet"],"created_at":"2025-06-07T08:06:10.340Z","updated_at":"2025-07-01T09:33:42.282Z","avatar_url":"https://github.com/ApeWorX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Start\n\nAccount plugin for the [Safe](https://safe.global//) Multisig wallet (previously known as Gnosis Safe).\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.\n\n## Installation\n\n### via `ape`\n\nYou can install using the [ape](https://github.com/ApeWorX/ape) built-in plugin manager:\n\n```bash\n$ ape plugins install safe\n```\n\n### via `pip`\n\nYou can install the latest release via [`pip`](https://pypi.org/project/pip/):\n\n```bash\n$ pip install ape-safe\n```\n\n### via `setuptools`\n\nYou can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:\n\n```bash\n$ git clone https://github.com/ApeWorX/ape-safe.git\n$ cd ape-safe\n$ python3 setup.py install\n```\n\n## Quick Usage\n\nTo use the plugin, first use the CLI extension to add a safe you created:\n\n```sh\nape safe add --network ethereum:mainnet \"my-safe.eth\" my-safe\n```\n\nIf you made a mistake or just need to remove the safe, use the `remove` command:\n\n```sh\nape safe remove my-safe --yes\n```\n\n**NOTE** `--yes` is a way to skip the prompt.\n\nIf you only add one safe, you will not have to specify which safe to use other commands.\nOtherwise, for most `pending` commands, you specify the safe to use (by alias) via the `--safe` option.\n\nAdditionally, you can configure a safe to use as the default in your `ape-config.yaml` file:\n\n```yaml\nsafe:\n  default_safe: my-safe\n```\n\nor via `pyproject.toml`:\n\n```toml\n[tool.ape.safe]\ndefault_safe = \"my-safe\"\n```\n\nTo specify via environment variable, do:\n\n```sh\nAPE_SAFE_DEFAULT_SAFE=\"my-safe\"\n```\n\n**NOTE**: Also, to avoid always needing to specify `--network`, you can set a default ecosystem, network, and provider in your config file.\nThe rest of the guide with not specify `--network` on each command but assume the correct one is set in the config file.\nHere is an example:\n\n```yaml\ndefault_ecosystem: optimism\n\nethereum:\n  default_network: sepolia\n  sepolia:\n    default_provider: infura\n```\n\nOnce you have a safe, you can view pending transactions:\n\n```sh\nape safe pending list\n```\n\n```{note}\nYou must specify the environment variable `APE_SAFE_GATEWAY_API_KEY=` to use the Safe Gateway API.\nGet an API key at https://developer.safe.global/.\n```\n\nIt should show transactions like this:\n\n```sh\nTransaction 8 rejection (1/2) safe_tx_hash=0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7\nTransaction 8 transfer  (1/2) safe_tx_hash=0xed43d80255bcd5ffacb755e8f51bee825913373705d6baea006419d2a33a0a5b\n```\n\n**NOTE**: Use the `--verbose` flag to see more information about each transaction.\n\n```sh\nape safe pending list --verbose\n```\n\nThere are several operations you can do on a pending transaction.\nOne of them is \"approve\" which adds your local signers' signatures to the transaction.\n\n```sh\nape safe pending approve 0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7\n```\n\n**NOTE**: Here we are using the transaction hash `0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7` to specify the transaction because there are more than one.\nHowever, you can also use the nonce if there is only a single transaction.\n\nIf you want to both execute and approve at the same time, you can use the `--execute` option on approve and specify a sender:\n\n```sh\nape safe pending approve 2 --execute my_account\n```\n\nElse, you can use the `execute` command directly:\n\n```sh\nape safe pending execute 2\n```\n\n**NOTE**: `execute` requires a full signed transaction ready to be submitted on-chain.\n\nThe last main operation is `reject`.\nRejecting a transaction replaces that transaction with a zero-value transfer from the safe to itself.\n\n```sh\nape safe pending reject 2\n```\n\n### Multisend\n\nThe following example shows how to use multisend:\n\n```python\nfrom ape_safe import multisend\nfrom ape import accounts\nfrom ape_tokens import tokens\n\nsafe = accounts.load(\"my-safe\")\n\n# Load some contracts (here using ape-tokens)\ndai = tokens[\"DAI\"]\nvault = tokens[\"yvDAI\"]\namount = dai.balanceOf(safe)  # How much we want to deposit\n\n# Create a multisend transaction (a transaction that executes multiple calls)\ntxn = multisend.MultiSend()\ntxn.add(dai.approve, vault, amount)\ntxn.add(vault.deposit, amount)\n\n# Fetch signatures from any local signers, and broadcast if confirmations are met\n# Note that in case the user intends to only stage a transaction, then `submit=False` argument can also be added\n# It is normal that when a user only intend to stage a transaction, an error is thrown\n# this can be ignored by including the necessary try-catch (from ape.exceptions import SignatureError)\n# Note that transaction is automatically prompted for execution if enough signers are available in local\ntxn(sender=safe,gas=0)\n```\n\n## Cloud Usage\n\nTo use this plugin in a cloud environment, such as with the [Silverback Platform](https://silverback.apeworx.io), you will need to make sure that you have configured your Safe to exist within the environment.\nThe easiest way to do this is to use the `require` configuration item.\nTo specify a required Safe in your `ape-config.yaml` (which adds it into your `~/.ape/safe` folder if it doesn't exist), use:\n\n```yaml\nsafe:\n  require:\n    my-safe:\n      address: \"0x1234...AbCd\"\n      deployed_chain_ids: [1, ...]\n```\n\nor in `pyproject.toml`:\n\n```toml\n[tool.ape.safe.require.\"my-safe\"]\naddress = \"0x1234...AbCd\"\ndeployed_chain_ids = [1, ...]\n```\n\nTo specify via environment variable, do:\n\n```sh\nAPE_SAFE_REQUIRE='{\"my-safe\":{\"address\":\"0x1234...AbCd\",\"deployed_chain_ids\":[1,...]}}'\n```\n\n```{notice}\nIf a safe with the same alias as an entry in `require` exists in your local environment, this will skip adding it, even if the existing alias points to a different address than the one in the config item.\n```\n\n## Development\n\nPlease see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.\nComments, questions, criticisms and pull requests are welcomed.\n\n## Acknowledgements\n\nThis package was inspired by [the original ape-safe](https://github.com/banteg/ape-safe#readme) by [banteg](https://github.com/banteg).\nFor versions prior to v0.6.0, the original package should be referenced.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapeworx%2Fape-safe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapeworx%2Fape-safe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapeworx%2Fape-safe/lists"}