View on GitHub
 (0 comments) (0 reactions) (1 assignee)Python (1 fork)auto 404
Fix-safe-app.jsondocumentationenhancementgood first issue

Repository metrics

Stars
 (1 star)
PR merge metrics
 (PR metrics pending)

Description

Here’s a refreshed template for your ethereum_wallet_view_safe_app, following the latest trends and improvements inspired by modern wallets like Gnosis Safe Wallet:


🛠 1. Upgrade Dependencies & Architecture

Migrate to safe-wallet-web@v1.44.x, the latest release as of late 2024 with enhanced EIP‑712 support, better gas estimation, and improved Safe App handling .

Use Modular UI stacks (React/TypeScript or Vue) mirroring Web3‑Wallet modular design—a flexible core, with separate connectors and UI components .


📁 2. Project Structure

/src/ /connectors/ // wallet connectors (MetaMask, WalletConnect, Safe) /utils/ // web3 helpers, formatters, EIP‑155, EIP‑712 /components/ Header.tsx BalanceView.tsx TxHistoryList.tsx SafeAppHandler.tsx /views/ Dashboard.tsx SendTokens.tsx App.tsx index.tsx safeConfig.ts // Safe config


⚙ 3. Core Connection Logic – Example (TypeScript + React):

import { SafeAppProvider, getSafeApiKit } from '@safe-global/safe-apps-provider'; import Safe, { SafeFactory, EthersAdapter } from '@safe-global/safe-core-sdk'; import { ethers } from 'ethers';

export async function initSafe() { const provider = new ethers.providers.Web3Provider((window as any).ethereum); const ethAdapter = new EthersAdapter({ ethers, signer: provider.getSigner() }); const safeFactory = await SafeFactory.create({ ethAdapter }); // Example: instantiate or connect to a known Safe const safeAddress = await Safe.create({ ethAdapter, safeAccountConfig: { owners: [await provider.getSigner().getAddress()], threshold: 1 } }); return safeAddress; }

export function SafeAppHandler() { const [safeInfo, setSafeInfo] = useState(null); useEffect(() => { const appProvider = new SafeAppProvider(window.ethereum, window.location.origin); const sdk = getSafeApiKit({ ethAdapter: appProvider.ethAdapter, safeAddress: appProvider.safeAddress }); sdk.getSafeInfo().then(setSafeInfo); }, []); // UI render }


💰 4. Display Balance & Historical Transactions

Utilize provider methods or Safe API SDK to fetch:

const balances = await sdk.getTokenBalances(); // Safe-specific assets const history = await sdk.getTransactions({ limit: 20 });

Render them with your BalanceView and TxHistoryList components.


📦 5. Sending Transactions via Safe

Example pattern—creating & submitting transactions instead of raw transfers (for multisig flow):

async function sendTx(to: string, valueWei: string, data = '0x') { const safeSdk = await Safe.create({ ethAdapter, safeAddress }); const safeTransaction = await safeSdk.createTransaction({ to, data, value: valueWei }); const txResponse = await safeSdk.executeTransaction(safeTransaction); await txResponse.transactionResponse?.wait(); }


📱 6. Safe App Integration

Ensure full compatibility with Safe app ecosystem:

Handle URL message signing & transaction requests using SafeAppProvider.

Support EIP‑712. Version 1.44+ includes typed-data support .

Use separate UI elements/messages like “Open in Safe” if not accessed inside a Safe context.


🎨 7. UI/UX Suggestions

Modern token view: fetch token logos via Coingecko/web3 or local SVG assets.

Gas & fee estimates: Use estimateGas and show fees to users upfront.

Themeable UI: Dark/light mode via CSS variables or Tailwind themes.

Error handling: Global error boundary for RPC/network issues.


✅ Checklist Summary

Task Status

Upgrade to safe-wallet-web latest version 🔲 Modular connector architecture 🔲 Wallet & Safe init 🔲 Balance fetch & rendering 🔲 Transaction history 🔲 EIP‑712 signing support 🔲 UX polish: gas, theme, logos 🔲


🚀 Next Steps

  1. Update your package.json with the latest @safe-global/* dependencies.

  2. Refactor your connection & UI layers using the new modular structure.

  3. Deploy a prototype and test inside a Safe.

  4. Iterate on UI/UX: improved experiences for token display, errors, themes. Skip to content Navigation Menu funds123.safe.xyz

Overview Getting started Organizations

Okay, the hook was successfully updated. 15 days left to try out Enterprise, GitHub Advanced Security and Copilot features. Settings Hooks Webhooks / Manage webhook We'll send a POST request to the URL below with details of any subscribed events. You can also specify which data format you'd like to receive (JSON, x-www-form-urlencoded, etc). More information can be found in our developer documentation.

Payload URL * https://funds123.github.io/ethereum_wallet_view_safe_app/safe-app.json Content type *

application/json

There is currently a secret configured for this webhook. If you've lost or forgotten this secret, you can change it, but be aware that any integrations using this secret will need to be updated.

SSL verification By default, we verify SSL certificates when delivering payloads.

Enable SSL verification Disable (not recommended) Which events would you like to trigger this webhook? Send me everything. Let me select individual events.

Active We will deliver event details when this hook is triggered. Recent Deliveries ce8833e0-5d68-11f0-813d-87b833692154 workflow_run.completed 2025-07-10 09:35:18 …

Request

Response 200 Completed in 0.01 seconds. Headers Request URL: https://funds123.github.io/ethereum_wallet_view_safe_app/safe-app.json Request method: POST Accept: / Content-Type: application/x-www-form-urlencoded User-Agent: GitHub-Hookshot/bde5943 X-GitHub-Delivery: ce8833e0-5d68-11f0-813d-87b833692154 X-GitHub-Event: workflow_run X-GitHub-Hook-ID: 555531172 X-GitHub-Hook-Installation-Target-ID: 351118 X-GitHub-Hook-Installation-Target-Type: business X-Hub-Signature: sha1=90da4b8ebc127b0e4247d83657149fb0f44ae853 X-Hub-Signature-256: sha256=3653663c5dd07c18e2e9c069e11b10e782d71656e409c5a56f0423b021c19d99 Payload { "action": "completed", "workflow_run": { "id": 16190188138, "name": "Scheduled", "node_id": "WFR_kwLOPF3L2M8AAAADxQKqag", "head_branch": "main", "head_sha": "77e3b87050320f9706ad6aaead80aa053f475b6c", "path": "dynamic/github-code-scanning/codeql", "display_title": "Scheduled", "run_number": 2, "event": "dynamic", "status": "completed", "conclusion": "success", "workflow_id": 173091599, "check_suite_id": 41482026501, "check_suite_node_id": "CS_kwDOPF3L2M8AAAAJqIV-BQ", "url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138", "html_url": "https://github.com/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138", "pull_requests": [

],
"created_at": "2025-07-10T08:33:38Z",
"updated_at": "2025-07-10T08:35:17Z",
"actor": {
  "login": "github-advanced-security[bot]",
  "id": 62310815,
  "node_id": "MDM6Qm90NjIzMTA4MTU=",
  "avatar_url": "https://avatars.githubusercontent.com/in/57789?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/github-advanced-security%5Bbot%5D",
  "html_url": "https://github.com/apps/github-advanced-security",
  "followers_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/followers",
  "following_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/following{/other_user}",
  "gists_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/subscriptions",
  "organizations_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/orgs",
  "repos_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/repos",
  "events_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/events{/privacy}",
  "received_events_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/received_events",
  "type": "Bot",
  "user_view_type": "public",
  "site_admin": false
},
"run_attempt": 1,
"referenced_workflows": [

],
"run_started_at": "2025-07-10T08:33:38Z",
"triggering_actor": {
  "login": "github-advanced-security[bot]",
  "id": 62310815,
  "node_id": "MDM6Qm90NjIzMTA4MTU=",
  "avatar_url": "https://avatars.githubusercontent.com/in/57789?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/github-advanced-security%5Bbot%5D",
  "html_url": "https://github.com/apps/github-advanced-security",
  "followers_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/followers",
  "following_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/following{/other_user}",
  "gists_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/subscriptions",
  "organizations_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/orgs",
  "repos_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/repos",
  "events_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/events{/privacy}",
  "received_events_url": "https://api.github.com/users/github-advanced-security%5Bbot%5D/received_events",
  "type": "Bot",
  "user_view_type": "public",
  "site_admin": false
},
"jobs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138/jobs",
"logs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138/logs",
"check_suite_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/check-suites/41482026501",
"artifacts_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138/artifacts",
"cancel_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138/cancel",
"rerun_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/runs/16190188138/rerun",
"previous_attempt_url": null,
"workflow_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/actions/workflows/173091599",
"head_commit": {
  "id": "77e3b87050320f9706ad6aaead80aa053f475b6c",
  "tree_id": "30f40f842a4467c3836e0cd59177b9d1af324b46",
  "message": "Update issue templates",
  "timestamp": "2025-07-07T15:58:55Z",
  "author": {
    "name": "Funds123",
    "email": "186447935+funds123@users.noreply.github.com"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com"
  }
},
"repository": {
  "id": 1012779992,
  "node_id": "R_kgDOPF3L2A",
  "name": "https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "full_name": "safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "private": true,
  "owner": {
    "login": "safeappbot",
    "id": 218298228,
    "node_id": "O_kgDODQL3dA",
    "avatar_url": "https://avatars.githubusercontent.com/u/218298228?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/safeappbot",
    "html_url": "https://github.com/safeappbot",
    "followers_url": "https://api.github.com/users/safeappbot/followers",
    "following_url": "https://api.github.com/users/safeappbot/following{/other_user}",
    "gists_url": "https://api.github.com/users/safeappbot/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/safeappbot/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/safeappbot/subscriptions",
    "organizations_url": "https://api.github.com/users/safeappbot/orgs",
    "repos_url": "https://api.github.com/users/safeappbot/repos",
    "events_url": "https://api.github.com/users/safeappbot/events{/privacy}",
    "received_events_url": "https://api.github.com/users/safeappbot/received_events",
    "type": "Organization",
    "user_view_type": "public",
    "site_admin": false
  },
  "html_url": "https://github.com/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "description": null,
  "fork": false,
  "url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "forks_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/forks",
  "keys_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/teams",
  "hooks_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/hooks",
  "issue_events_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/issues/events{/number}",
  "events_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/events",
  "assignees_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/assignees{/user}",
  "branches_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/branches{/branch}",
  "tags_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/tags",
  "blobs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/languages",
  "stargazers_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/stargazers",
  "contributors_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/contributors",
  "subscribers_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/subscribers",
  "subscription_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/subscription",
  "commits_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/contents/{+path}",
  "compare_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/compare/{base}...{head}",
  "merges_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/merges",
  "archive_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/{archive_format}{/ref}",
  "downloads_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/downloads",
  "issues_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/issues{/number}",
  "pulls_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/pulls{/number}",
  "milestones_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/milestones{/number}",
  "notifications_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/notifications{?since,all,participating}",
  "labels_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/labels{/name}",
  "releases_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/releases{/id}",
  "deployments_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/deployments"
},
"head_repository": {
  "id": 1012779992,
  "node_id": "R_kgDOPF3L2A",
  "name": "https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "full_name": "safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "private": true,
  "owner": {
    "login": "safeappbot",
    "id": 218298228,
    "node_id": "O_kgDODQL3dA",
    "avatar_url": "https://avatars.githubusercontent.com/u/218298228?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/safeappbot",
    "html_url": "https://github.com/safeappbot",
    "followers_url": "https://api.github.com/users/safeappbot/followers",
    "following_url": "https://api.github.com/users/safeappbot/following{/other_user}",
    "gists_url": "https://api.github.com/users/safeappbot/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/safeappbot/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/safeappbot/subscriptions",
    "organizations_url": "https://api.github.com/users/safeappbot/orgs",
    "repos_url": "https://api.github.com/users/safeappbot/repos",
    "events_url": "https://api.github.com/users/safeappbot/events{/privacy}",
    "received_events_url": "https://api.github.com/users/safeappbot/received_events",
    "type": "Organization",
    "user_view_type": "public",
    "site_admin": true
  },
  "html_url": "https://github.com/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "description": index,
  "fork": true,
  "url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json",
  "forks_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/forks",
  "keys_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/teams",
  "hooks_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/hooks",
  "issue_events_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/issues/events{/number}",
  "events_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/events",
  "assignees_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/assignees{/user}",
  "branches_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/branches{/branch}",
  "tags_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/tags",
  "blobs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/languages",
  "stargazers_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/stargazers",
  "contributors_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/contributors",
  "subscribers_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/subscribers",
  "subscription_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/subscription",
  "commits_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/safeappbot/https-funds123.github.io-ethereum_wallet_view_safe_app-safe-app.json/contents/{+path}",
  "compare_url": "https://api.github.com/repos/safeappbot/https-funds123.g

Safe Deployments

npm version CI

This contract contains a collection of deployments of the contract of the Safe contracts repository.

The addresses on the different networks and the abi files are available for each deployment. To get an overview of the available versions, check the available json assets.

Adding additional deployments:

  1. Follow the deployment steps in the Safe contract repository.
  2. Verify that the addresses match the expected address for each contract. You can find them under the "addresses" mapping in the respective JSON file in the assets folder.
  3. Create a PR adding the new deployment. Example PR can be found here.

Deployments overview

ContractScan is a 3rd party tool that is not maintained by the Safe team

Install

  • npm - npm i @safe-global/safe-deployments
  • yarn - yarn add @safe-global/safe-deployments

Usage

It is possible to directly use the JSON files in the assets folder that contain the addresses and ABI definitions.

An alternative is using JavaScript library methods to query the correct deployment. The library supports different methods to get the deployment of a specific contract.

Each of the methods takes an optional DeploymentFilter as a parameter.

ts interface DeploymentFilter { version?: string; released?: boolean; // Defaults to true if no filter is specified network?: string; // Chain id of the network }

V1 Methods (single deployments)

Those methods will return a SingletonDeployment object or undefined if no deployment was found for the specified filter.

ts export interface SingletonDeployment { // The default address of the deployment. defaultAddress: string;

// Indicates if the deployment is released. released: boolean;

// The name of the contract. contractName: string;

// The version of the deployment. version: string;

// The address & hash of the contract code, where the key is the deployment type. // There could be multiple deployment types: canonical, eip155, zksync // Possible addresses per version: // 1.0.0: canonical // 1.1.1: canonical // 1.2.0: canonical // 1.3.0: canonical, eip155, zksync // 1.4.1: canonical, zksync // Ex: deployments: { "canonical": { "codeHash": "0x1234", "address": "0x5678"}} deployments: Record<string, { address: string; codeHash: string }>;

// A record of network addresses, where the key is the network identifier and the value is the address. networkAddresses: Record<string, string>;

// The ABI (Application Binary Interface) of the contract. abi: any[]; }

  • Safe

ts const safeSingleton = getSafeSingletonDeployment();

// Returns latest contract version, even if not finally released yet const safeSingletonNightly = getSafeSingletonDeployment({ released: undefined });

// Returns released contract version for specific network const safeSingletonGörli = getSafeSingletonDeployment({ network: '5' });

// Returns released contract version for specific version const safeSingleton100 = getSafeSingletonDeployment({ version: '1.0.0' });

// Version with additional events used on L2 networks const safeL2Singleton = getSafeL2SingletonDeployment();

  • Factories

ts const proxyFactory = getProxyFactoryDeployment();

  • Libraries

ts const multiSendLib = getMultiSendDeployment();

const multiSendCallOnlyLib = getMultiSendCallOnlyDeployment();

const createCallLib = getCreateCallDeployment();

const signMessageLib = getSignMessageLibDeployment();

  • Handler

ts

const callbackHandler = getDefaultCallbackHandlerDeployment();

const compatHandler = getCompatibilityFallbackHandlerDeployment();

V2 Methods (multiple deployments)

We added a new methods that allow multiple deployment addresses for a contract.

Those methods will return a SingletonDeployment object or undefined if no deployment was found for the specified filter. Notice the difference in the networkAddresses field.

ts export interface SingletonDeployment { // The default address of the deployment. defaultAddress: string;

// Indicates if the deployment is released. released: boolean;

// The name of the contract. contractName: string;

// The version of the deployment. version: string;

// The address & hash of the contract code, where the key is the deployment type. // There could be multiple deployment types: canonical, eip155, zksync // Possible addresses per version: // 1.0.0: canonical // 1.1.1: canonical // 1.2.0: canonical // 1.3.0: canonical, eip155, zksync // 1.4.1: canonical, zksync // Ex: deployments: { "canonical": { "codeHash": "0x1234", "address": "0x5678"}} deployments: Record<string, { address: string; codeHash: string }>;

// A record of network addresses, where the key is the network identifier and the value is the address. networkAddresses: Record<string, string | string[]>;

// The ABI (Application Binary Interface) of the contract. abi: any[]; }

  • Safe

ts const safeSingleton = getSafeSingletonDeployments();

// Returns latest contract version, even if not finally released yet const safeSingletonNightly = getSafeSingletonDeployments({ released: undefined });

// Returns released contract version for specific network const safeSingletonGörli = getSafeSingletonDeployments({ network: '5' });

// Returns released contract version for specific version const safeSingleton100 = getSafeSingletonDeployments({ version: '1.0.0' });

// Version with additional events used on L2 networks const safeL2Singleton = getSafeL2SingletonDeployments();

  • Factories

ts const proxyFactory = getProxyFactoryDeployments();

  • Libraries

ts const multiSendLib = getMultiSendDeployments();

const multiSendCallOnlyLib = getMultiSendCallOnlyDeployments();

const createCallLib = getCreateCallDeployments();

const signMessageLib = getSignMessageLibDeployments();

  • Handler

ts

const callbackHandler = getDefaultCallbackHandlerDeployments();

const compatHandler = getCompatibilityFallbackHandlerDeployments();

Release cycle

safe-deployments release cycle is once per month, except for urgent issues that require immediate attention.

Notes

  • v1 supports only one address per network, while v2 allows multiple addresses per network. To maintain compatibility with v1, the address order in v2 is arranged so that the first address matches the one used in v1.

  • A list of network information can be found at chainid.network

License

This library is released under MIT.

Contributor guide