From 558747a249af1d7d8460989da182066e2a175c71 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:47:56 +0100 Subject: [PATCH 1/9] Reorder sidebar (#292) * Update SUMMARY.md * Update and rename available-services.md to supported-networks.md --- SUMMARY.md | 6 +++--- .../{available-services.md => supported-networks.md} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename safe-core-api/{available-services.md => supported-networks.md} (96%) diff --git a/SUMMARY.md b/SUMMARY.md index 36a13b87..163ed391 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -62,13 +62,13 @@ ## Safe{Core} API -* [Available Services](safe-core-api/available-services.md) - * [Service Architecture](safe-core-api/service-architecture.md) * [Safe Transaction Service](safe-core-api/safe-transaction-service.md) * [RPC Requirements](safe-core-api/rpc-requirements.md) +* [Supported Networks](safe-core-api/supported-networks.md) + ## Safe Apps SDK * [Overview](safe-apps/README.md) @@ -80,5 +80,5 @@ ## Miscellaneous * [Bug Bounty](miscellaneous/bug-bounty-program.md) -* [Past paid bounties](miscellaneous/past-paid-bounties.md) + * [Past paid bounties](miscellaneous/past-paid-bounties.md) * [Contact us](miscellaneous/contact-us.md) diff --git a/safe-core-api/available-services.md b/safe-core-api/supported-networks.md similarity index 96% rename from safe-core-api/available-services.md rename to safe-core-api/supported-networks.md index b2e6601a..af716658 100644 --- a/safe-core-api/available-services.md +++ b/safe-core-api/supported-networks.md @@ -1,8 +1,8 @@ --- -description: This pages provides an overview of the available services +description: This page provides an overview of the available services --- -# Available Services +# Supported Networks ## Safe Transaction Service From d393a624083b45264eb236c09950688aeeb29e96 Mon Sep 17 00:00:00 2001 From: Daniel <25051234+dasanra@users.noreply.github.com> Date: Thu, 30 Nov 2023 08:01:37 +0100 Subject: [PATCH 2/9] Add legacy `safe-core-sdk` migration guide (#291) * update ethers docs * add singleton change to api-kit and protocol-kit update api-kit initialization update createTransaction use * Fix linting and typos * fix: broken links * update GelatoRelayKit breaking changes * improve parameter naming * fix linter reported issue * fix wording recommendations * highlight ethers.js v6 * add migration guides highlighting the major changes * fix typos * Apply suggestions from code review Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> * add backticks to EthersAdapter * Apply suggestions from code review Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> * set migrating guides below reference * add wording suggestions * Add safe-transaction-service migration guide * Add migration guide from legacy safe-core-sdk * Add types changes * remove auth-kit changes * fix linting issues * improve api-kit v2 migration * Add latest changes * Add missing type * fix typo * Apply suggestions from code review Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> * add migration links * Update safe-core-sdk/protocol-kit/reference/migrating/v1.md Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> * Reverse migration links order in SUMMARY --------- Co-authored-by: Daniel Somoza Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- SUMMARY.md | 2 + .../api-kit/reference/migrating/v1.md | 114 ++++++++++++++++++ .../api-kit/reference/migrating/v2.md | 32 ++++- .../protocol-kit/reference/migrating/v1.md | 102 ++++++++++++++++ .../protocol-kit/reference/migrating/v2.md | 2 + 5 files changed, 247 insertions(+), 5 deletions(-) create mode 100644 safe-core-sdk/api-kit/reference/migrating/v1.md create mode 100644 safe-core-sdk/protocol-kit/reference/migrating/v1.md diff --git a/SUMMARY.md b/SUMMARY.md index 163ed391..666c55ef 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -35,6 +35,7 @@ * [Protocol Kit](safe-core-sdk/protocol-kit/README.md) * [Reference](safe-core-sdk/protocol-kit/reference/README.md) * [Migrating to v2](safe-core-sdk/protocol-kit/reference/migrating/v2.md) + * [Migrating to v1](safe-core-sdk/protocol-kit/reference/migrating/v1.md) * [Onramp Kit](safe-core-sdk/onramp-kit/README.md) * [Guides](safe-core-sdk/onramp-kit/guides/README.md) @@ -54,6 +55,7 @@ * [API Kit](safe-core-sdk/api-kit/README.md) * [Reference](safe-core-sdk/api-kit/reference/README.md) * [Migrating to v2](safe-core-sdk/api-kit/reference/migrating/v2.md) + * [Migrating to v1](safe-core-sdk/api-kit/reference/migrating/v1.md) ## Safe{Core} Protocol diff --git a/safe-core-sdk/api-kit/reference/migrating/v1.md b/safe-core-sdk/api-kit/reference/migrating/v1.md new file mode 100644 index 00000000..0d581a11 --- /dev/null +++ b/safe-core-sdk/api-kit/reference/migrating/v1.md @@ -0,0 +1,114 @@ +# API Kit: Migrating from `safe-service-client` + +This guide references the major changes between `safe-service-client` and `api-kit` v1 to help those migrating an existing application. + +**Note:** Follow this guide before migrating to `api-kit` v2. + +After completing this guide, you can remove `@safe-global/safe-service-client` from your package.json`. + +## Adding the new dependency + +To add the API Kit to your project, run the following: + +```bash +yarn add @safe-global/api-kit@1.3.1 +``` + +Change your initialization like this: + +```typescript +// old +import SafeServiceClient from '@safe-global/safe-service-client' + +const safeService = new SafeServiceClient({ + txServiceUrl: 'https://your-transaction-service-url', + ethAdapter +}) + +// new +import SafeApiKit from '@safe-global/api-kit' + +const apiKit = new SafeApiKit({ + txServiceUrl: 'https://your-transaction-service-url', + ethAdapter +}) +``` + +## `getSafeDelegates()` + +The `getSafeDelegates` was updated to accept more filtering parameters. Now, it accepts an object with multiple properties instead of only the `safeAddress` parameter. + +```typescript +const delegateConfig: GetSafeDelegateProps = { + safeAddress, // Optional + delegateAddress, // Optional + delegatorAddress, // Optional + label, // Optional + limit, // Optional + offset // Optional +} +const delegates: SafeDelegateListResponse = await apiKit.getSafeDelegates(delegateConfig) +``` + +## `addSafeDelegate()` + +Parameter object properties were updated as follows: + +```typescript +// old +const delegateConfig: SafeDelegateConfig = { + safe, + delegate, + label, + signer +} +await safeService.addSafeDelegate(delegateConfig) + +// new +const delegateConfig: AddSafeDelegateProps = { + safeAddress, // Optional + delegateAddress, + delegatorAddress, + label, + signer +} +await apiKit.addSafeDelegate(delegateConfig) +``` + +## `removeAllSafeDelegates()` + +The method was deprecated and removed. + +## `removeSafeDelegate()` + +Parameter object properties were updated as follows: + +```typescript +// old +const delegateConfig: SafeDelegateDeleteConfig = { + safe, + delegate, + signer +} +await safeService.removeSafeDelegate(delegateConfig) + +// new +const delegateConfig: DeleteSafeDelegateProps = { + delegateAddress, + delegatorAddress, + signer +} +await apiKit.removeSafeDelegate(delegateConfig) +``` + +## `getBalances()` + +The method was deprecated and removed. + +## `getUSDBalances()` + +The method was deprecated and removed. + +## `getCollectibles()` + +The method was deprecated and removed. \ No newline at end of file diff --git a/safe-core-sdk/api-kit/reference/migrating/v2.md b/safe-core-sdk/api-kit/reference/migrating/v2.md index 66458fb8..67fddd19 100644 --- a/safe-core-sdk/api-kit/reference/migrating/v2.md +++ b/safe-core-sdk/api-kit/reference/migrating/v2.md @@ -8,10 +8,26 @@ It won't be necessary to specify a `txServiceUrl` in environments where Safe has ```js // old: -constructor({ txServiceUrl, ethAdapter }: SafeApiKitConfig) +import SafeApiKit from '@safe-global/api-kit' + +const apiKit = new SafeApiKit({ + txServiceUrl: 'https://your-transaction-service-url', + ethAdapter +}) // new: -constructor({ chainId, txServiceUrl? }: SafeApiKitConfig) +import SafeApiKit from '@safe-global/api-kit' + +const chainId: bigint = 1n +const apiKit = new SafeApiKit({ + chainId +}) + +// or set a custom Transaction Service +const apiKit = new SafeApiKit({ + chainId, + txServiceUrl: 'https://your-transaction-service-url' +}) ``` ## Use the route you prefer @@ -23,11 +39,17 @@ Note that if you use a custom service running under `/api`, you will now need to ```js // old: const txServiceUrl = 'https://your-transaction-service-domain/' -constructor({ txServiceUrl, ethAdapter }: SafeApiKitConfig) - +const apiKit = new SafeApiKit({ + txServiceUrl, + ethAdapter +}) // new: +const chainId: bigint = 1n const txServiceUrl = 'https://your-transaction-service-domain/api' -constructor({ chainId, txServiceUrl? }: SafeApiKitConfig) +const apiKit = new SafeApiKit({ + chainId, + txServiceUrl +}) ``` ## MasterCopy to Singleton diff --git a/safe-core-sdk/protocol-kit/reference/migrating/v1.md b/safe-core-sdk/protocol-kit/reference/migrating/v1.md new file mode 100644 index 00000000..3467699f --- /dev/null +++ b/safe-core-sdk/protocol-kit/reference/migrating/v1.md @@ -0,0 +1,102 @@ +# Protocol Kit: Migrating from `safe-core-sdk` + +This guide references the major changes between `safe-core-sdk` and `protocol-kit` v1 to help those migrating an existing application. + +**Note:** Follow this guide before migrating to `protocol-kit` v2. + +You can remove `@safe-global/safe-core-sdk` from your `package.json` after completing this guide. + +## Adding the new dependency + +To add the Protocol Kit to your project, run the following: + +```bash +yarn add @safe-global/protocol-kit@1.3.0 +``` + +If you use the types library, you will need to update to v2.3.0: + +```bash +yarn add @safe-global/safe-core-sdk-types@2.3.0 +``` + +## `EthAdapter` + +### `EthersAdapter` (safe-ethers-lib) + +`EthersAdapter` isn't in a separate package anymore. Now, it's provided inside the `protocol-kit` package. + +**`protocol-kit v1` only supports `ethers v5`** + +```typescript +// old +import EthersAdapter from '@safe-global/safe-ethers-lib' + +// new +import { EthersAdapter } from '@safe-global/protocol-kit' +``` + +After this change, you can remove `@safe-global/safe-ethers-lib` from your `package.json`. + +### `Web3Adapter` (safe-web3-lib) + +`Web3Adapter` isn't in a separate package anymore. Now, it's part of the `protocol-kit` package. + +**Note:** `protocol-kit` v1 only supports Web3.js v1. + +```typescript +// old +import Web3Adapter from '@safe-global/safe-web3-lib' + +// new +import { Web3Adapter } from '@safe-global/protocol-kit' +``` + +After this change, you can remove `@safe-global/safe-web3-lib` from your `package.json`. + +### Type changes + +Type changes are affecting the web3 and ethers adapter libraries. + +`getSafeContract`, `getMultisendContract`, `getMultisendCallOnlyContract`, `getCompatibilityFallbackHandlerContract`, `getSafeProxyFactoryContract`, `getSignMessageLibContract` and `getCreateCallContract` don't need the `chainId` parameter anymore, they will use the chain set on the provider. Also, they return a `Promise` now. + +`estimateGas` now returns a `string` instead of a `number`. + +## `safeFactory.deploySafe()` + +`SafeDeploymentConfig` was simplified. If you were using a `saltNonce` you should set it like this: + +```typescript +// old +const safeAccountConfig: SafeAccountConfig = { + ... +} +const safeDeploymentConfig: SafeDeploymentConfig = { saltNonce } + +const safeSdk = await safeFactory.deploySafe({ safeAccountConfig, safeDeploymentConfig }) + +// new +const safeAccountConfig: SafeAccountConfig = { + ... +} + +const saltNonce = '' + +const safeSdk = await safeFactory.deploySafe({ safeAccountConfig, saltNonce }) +``` + +## `getAddress()` + +The `getAddress()` method now returns a `Promise`. + +```typescript +// old +const safeAddress = safeSdk.getAddress() + +// new +const safeAddress = await protocolKit.getAddress() +``` + +## General type changes + +If you set `safeTxGas`, `baseGas`, or `gasPrice`, you must use the type `string` instead of `number`. \ No newline at end of file diff --git a/safe-core-sdk/protocol-kit/reference/migrating/v2.md b/safe-core-sdk/protocol-kit/reference/migrating/v2.md index 5348835e..4d34d9ae 100644 --- a/safe-core-sdk/protocol-kit/reference/migrating/v2.md +++ b/safe-core-sdk/protocol-kit/reference/migrating/v2.md @@ -2,6 +2,8 @@ This guide references the major changes between v1 and v2 to help those migrating an existing app. +**Note:** When upgrading to `protocol-kit` v2, it's necessary to upgrade to `safe-core-sdk-types` v3. + ## MasterCopy to Singleton To avoid confusion between terms used as synonyms, we aligned all our code to use the word `singleton`. From a175bad88f4d5f517de91eed809b90677eec3c5e Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:36:54 +0100 Subject: [PATCH 3/9] Add middleware information for Safe Apps (#293) * Update get-started.md * Update accept.txt --- .github/styles/Vocab/default/accept.txt | 1 + safe-apps/get-started.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/styles/Vocab/default/accept.txt b/.github/styles/Vocab/default/accept.txt index 3074b0a2..a9e67c8f 100644 --- a/.github/styles/Vocab/default/accept.txt +++ b/.github/styles/Vocab/default/accept.txt @@ -72,6 +72,7 @@ Kovan LUKSO Lightlink Linea +middleware MainNet Mainnet Mandala diff --git a/safe-apps/get-started.md b/safe-apps/get-started.md index e5dd6f36..caea78cc 100644 --- a/safe-apps/get-started.md +++ b/safe-apps/get-started.md @@ -96,6 +96,8 @@ module.exports = { } ``` +We also offer a [middleware](https://github.com/safe-global/safe-apps-sdk/blob/4dad4fdf700ed299d3a81cc08cd4928b137787e9/packages/cra-template-safe-app/template/src/setupProxy.js#L1-L15) in our React template for using frameworks like Express, Next.js, etc. + **SSL** To enable SSL with `react-scripts`, it is necessary to set the `HTTPS` environment variable to `true`. This can be done in the `package.json` file by adjusting the `scripts` section to: From e6db49c78dad6ccd6b064f7ffe5f738715e3a70d Mon Sep 17 00:00:00 2001 From: Daniel <25051234+dasanra@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:26:41 +0100 Subject: [PATCH 4/9] Fix error in code snippet (#295) --- safe-core-sdk/protocol-kit/reference/migrating/v2.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/safe-core-sdk/protocol-kit/reference/migrating/v2.md b/safe-core-sdk/protocol-kit/reference/migrating/v2.md index 4d34d9ae..43c28128 100644 --- a/safe-core-sdk/protocol-kit/reference/migrating/v2.md +++ b/safe-core-sdk/protocol-kit/reference/migrating/v2.md @@ -46,5 +46,8 @@ const options = { nonce: '', safeTxGas: '' } -const safeTransaction = protocolKit.createTransaction({ [safeTransactionData], options }) +const safeTransaction = protocolKit.createTransaction({ + transactions: [safeTransactionData], + options +}) ``` \ No newline at end of file From f660d7bda96270bcd4a730af44dded1669b9141c Mon Sep 17 00:00:00 2001 From: Daniel <25051234+dasanra@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:49:39 +0100 Subject: [PATCH 5/9] docs(auth-kit): Update docs for the new `SafeAuthPack` (#289) * add protocol-kit v2 updates * Add SafeAuth information * Update ethersv6 changes --- .github/styles/Vocab/default/accept.txt | 5 + SUMMARY.md | 4 +- safe-core-sdk/auth-kit/README.md | 3 +- safe-core-sdk/auth-kit/guides/safe-auth.md | 179 ++++++++++++++ safe-core-sdk/auth-kit/guides/web3auth.md | 196 ---------------- .../auth-kit/reference/AuthKitBasePack.md | 41 ++-- safe-core-sdk/auth-kit/reference/README.md | 8 +- .../auth-kit/reference/SafeAuthPack.md | 220 ++++++++++++++++++ .../auth-kit/reference/Web3AuthModalPack.md | 152 ------------ 9 files changed, 440 insertions(+), 368 deletions(-) create mode 100644 safe-core-sdk/auth-kit/guides/safe-auth.md delete mode 100644 safe-core-sdk/auth-kit/guides/web3auth.md create mode 100644 safe-core-sdk/auth-kit/reference/SafeAuthPack.md delete mode 100644 safe-core-sdk/auth-kit/reference/Web3AuthModalPack.md diff --git a/.github/styles/Vocab/default/accept.txt b/.github/styles/Vocab/default/accept.txt index a9e67c8f..a8189683 100644 --- a/.github/styles/Vocab/default/accept.txt +++ b/.github/styles/Vocab/default/accept.txt @@ -88,6 +88,7 @@ Moonbeam Moonriver Mordor Nova +OAuth OP Offchain Onramp @@ -143,6 +144,7 @@ Ultron Velas Venidium WEMIX3.0 +WebSocket WSGI XDC ZetaChain @@ -161,8 +163,11 @@ endembed endhint multisig npm +onboarding offchain onchain +pluggable +reauthenticate sdk undefined v1 diff --git a/SUMMARY.md b/SUMMARY.md index 666c55ef..51f24f08 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -27,10 +27,10 @@ * [Auth Kit](safe-core-sdk/auth-kit/README.md) * [Guides](safe-core-sdk/auth-kit/guides/README.md) - * [Web3Auth](safe-core-sdk/auth-kit/guides/web3auth.md) + * [SafeAuth](safe-core-sdk/auth-kit/guides/safe-auth.md) * [Reference](safe-core-sdk/auth-kit/reference/README.md) * [AuthKitBasePack](safe-core-sdk/auth-kit/reference/AuthKitBasePack.md) - * [Web3AuthModalPack](safe-core-sdk/auth-kit/reference/Web3AuthModalPack.md) + * [SafeAuthPack](safe-core-sdk/auth-kit/reference/SafeAuthPack.md) * [Protocol Kit](safe-core-sdk/protocol-kit/README.md) * [Reference](safe-core-sdk/protocol-kit/reference/README.md) diff --git a/safe-core-sdk/auth-kit/README.md b/safe-core-sdk/auth-kit/README.md index 59912ce7..b09ab979 100644 --- a/safe-core-sdk/auth-kit/README.md +++ b/safe-core-sdk/auth-kit/README.md @@ -3,7 +3,8 @@ The Auth Kit creates an Ethereum address and authenticates a blockchain account using an email address, social media account, or crypto wallet like Metamask. You can get the Ethereum address and the associated safe addresses as an output for the sign-in process. The following guides show how to use the Auth Kit and integrate it into your project by using one of the packs: -- [Web3Auth Pack](./guides/web3auth.md) +- [SafeAuth Pack](./guides/safe-auth.md) ## Resources + - [Auth Kit on GitHub](https://github.com/safe-global/safe-core-sdk/tree/main/packages/auth-kit) diff --git a/safe-core-sdk/auth-kit/guides/safe-auth.md b/safe-core-sdk/auth-kit/guides/safe-auth.md new file mode 100644 index 00000000..7ed368fa --- /dev/null +++ b/safe-core-sdk/auth-kit/guides/safe-auth.md @@ -0,0 +1,179 @@ +# Integration with SafeAuth + +This guide demonstrates creating an externally-owned account using your email or social media account. Once authenticated, you can sign transactions and interact with your Safe accounts. + +The `SafeAuthPack` is an authentication system that utilizes the [Web3Auth](https://web3auth.io) MPC technology. It was developed in collaboration with Web3Auth to create a smooth onboarding experience for web2 users across different dapps. + +## Prerequisites + +- [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) + +### Install dependencies + +```bash +yarn add @safe-global/auth-kit @web3auth/safeauth-embed +``` + +## Create a SafeAuthPack instance + +We will use the `SafeAuthPack` exported from the `@safe-global/auth-kit` package. + +Create an instance of the [SafeAuthPack](https://github.com/safe-global/safe-core-sdk/tree/main/packages/auth-kit/src/packs/safe-auth/SafeAuthPack.ts) using the required `SafeAuthConfig` configuration object. + +> Supported networks: +> +> - Production: Ethereum, Polygon, BSC, Avalanche, Optimism, Celo, Arbitrum, Gnosis chain +> - Test: Goerli, Sepolia, Polygon Mumbai, BSC Testnet, Avalanche Testnet, Arbitrum Testnet, Optimism Testnet + +```typescript +import { + SafeAuthPack, + SafeAuthConfig, + SafeAuthInitOptions, +} from '@safe-global/auth-kit' + +const safeAuthConfig: SafeAuthConfig = { + txServiceUrl: 'https://safe-transaction-mainnet.safe.global', +} +const safeAuthInitOptions: SafeAuthInitOptions = { + enableLogging: true, + showWidgetButton: false, + chainConfig: { + blockExplorerUrl: 'https://etherscan.io', + chainId: '0x1', + displayName: 'Main Ethereum Network', + logo: 'eth.svg', + rpcTarget: `${rpcUrl}`, + ticker: 'ETH', + tickerName: 'Ethereum', + }, +} + +const safeAuthPack = new SafeAuthPack(safeAuthConfig) +await safeAuthPack.init(safeAuthInitOptions) +``` + +## Sign in to an Ethereum account + +After creating your `SafeAuthPack` instance, initiate the authentication process by calling the `signIn()` method. Typically, this method is called when the user clicks a "Sign In" button on the web page. + +After successfully signing in, you will create a new Ethereum Wallet. This wallet will be used for all future logins and can be **shared across different applications**. + +```typescript +// The signIn() method returns the user's Ethereum address and the associated Safe addresses +// The `await` will last until the user is authenticated. Therefore, it will be active while the authentication popup is being displayed. +const authKitSignData = await safeAuthPack.signIn() +``` + +The returned `authKitSignData` data contains the following properties: + +```typescript +AuthKitSignInData { + eoa: string // The safe signer + safes?: string[] // The list of associated Safe addresses in the chain +} +``` + +The `signOut()` method removes the current session. + +```typescript +await safeAuthPack.signOut() +``` + +After the user is authenticated, call `getProvider()` to get the Ethereum provider instance. This is a [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compatible provider you can wrap using your favorite library (web3, ethers). + +```typescript +safeAuthPack.getProvider() +``` + +We offer two methods for listening to events, `subscribe()` and `unsubscribe()`. + +```typescript +const accountChangedHandler = (accounts: string[]) => { + console.log('Signer accounts:', accounts) +} + +safeAuthPack.subscribe('accountsChanged', accountChangedHandler) +safeAuthPack.unsubscribe('accountsChanged', accountChangedHandler) +``` + +The `SafeAuthPack` instantiation will return the list of associated Safe addresses as part of the response from the `signIn()` method when the `txServiceUrl` is provided. + +```typescript +const safeAuthPack = new SafeAuthPack({ + txServiceUrl: 'https://safe-transaction-mainnet.safe.global', +}) +``` + +## Signing and executing transactions using the SafeAuthPack and Protocol Kit + +The `SafeAuthPack` can be used with the [Protocol Kit](../../protocol-kit/README.md) to establish a connection to a Safe. This connection is made using the `provider` and `signer` associated with the authenticated account. + +After connecting, you can use any of the methods provided in the [Protocol Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/protocol-kit#sdk-api). + +```typescript +import { ethers } from 'ethers' +import { EthersAdapter } from '@safe-global/protocol-kit' + +// Wrap EIP-1193 provider with ethers +const provider = new ethers.BrowserProvider(safeAuthPack.getProvider()) +const signer = provider.getSigner() + +// Create the Safe EthersAdapter +const ethAdapter = new EthersAdapter({ + ethers, + signerOrProvider: signer || provider, +}) + +// Instantiate the protocolKit +const protocolKit = await Safe.create({ + ethAdapter, + safeAddress, +}) + +// Create a Safe transaction with the provided parameters +const safeTransactionData: MetaTransactionData = { + to: `${ethAddress}`, + data: '0x', + value: ethers.parseUnits('0.0001', 'ether').toString(), +} + +const safeTransaction = await protocolKit.createTransaction({ + transactions: [safeTransactionData], +}) + +// Sign the transaction if the Safe have several owners +// safeTransaction = await protocolKit1.signTransaction(safeTransaction) +// safeTransaction = await protocolKit2.signTransaction(safeTransaction) + +// Execute the transaction +await protocolKit.executeTransaction(safeTransaction) +``` + +## Sign messages using the `SafeAuthPack` + +You can also sign any arbitrary message or transaction as a regular Signing Account with your favorite web3 library: + +```typescript +// Using web3 +const web3 = new Web3(safeAuthPack.getProvider()) + +await web3.eth.sendTransaction(tx) +await web3.eth.signTransaction(tx) +const message = 'hello world' +const address = '0x...' +await web3.eth.personal.sign(message, address) + +// Using ethers +const provider = new ethers.BrowserProvider(safeAuthPack.getProvider()) +const signer = provider.getSigner() + +await signer.sendTransaction(tx) +await signer.signTransaction(tx) +await signer.signMessage(message) +``` + +## Examples + +- [React](https://github.com/safe-global/safe-core-sdk/blob/main/packages/auth-kit/example/src/App.tsx) +- [Vanilla Typescript](https://github.com/5afe/safe-auth) diff --git a/safe-core-sdk/auth-kit/guides/web3auth.md b/safe-core-sdk/auth-kit/guides/web3auth.md deleted file mode 100644 index d949c17f..00000000 --- a/safe-core-sdk/auth-kit/guides/web3auth.md +++ /dev/null @@ -1,196 +0,0 @@ -# Integration with Web3Auth - -This guide demonstrate how to create an externally-owned account using your email or social media account. Once authenticated, you can sign transactions and interact with any Safe Smart Accounts you own. - -## Prerequisites - -- [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- [Create a Web3Auth account](https://dashboard.web3auth.io) - -### Install dependencies - -```bash -npm i @safe-global/auth-kit @web3auth/base@4.6.0 @web3auth/modal@4.6.2 @web3auth/openlogin-adapter@4.6.0 -``` - -## Create a Web3AuthModalPack instance - -We are going to use the provided `Web3AuthModalPack` exported in the `@safe-global/auth-kit` package. - -Create an instance of the [Web3AuthModalPack](https://github.com/safe-global/safe-core-sdk/tree/main/packages/auth-kit/src/packs/web3auth/Web3AuthModalPack.ts) using the required `Web3AuthConfig` configuration object. - -```typescript -import { Web3AuthModalPack, Web3AuthConfig } from '@safe-global/auth-kit' -import { Web3AuthOptions } from '@web3auth/modal' -import { OpenloginAdapter } from '@web3auth/openlogin-adapter' - - -// https://web3auth.io/docs/sdk/pnp/web/modal/initialize#arguments -const options: Web3AuthOptions = { - clientId: 'YOUR_WEB3_AUTH_CLIENT_ID', // https://dashboard.web3auth.io/ - web3AuthNetwork: 'testnet', - chainConfig: { - chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: '0x5', - // https://chainlist.org/ - rpcTarget: 'https://rpc.ankr.com/eth_goerli' - }, - uiConfig: { - theme: 'dark', - loginMethodsOrder: ['google', 'facebook'] - } -} - -// https://web3auth.io/docs/sdk/pnp/web/modal/initialize#configuring-adapters -const modalConfig = { - [WALLET_ADAPTERS.TORUS_EVM]: { - label: 'torus', - showOnModal: false - }, - [WALLET_ADAPTERS.METAMASK]: { - label: 'metamask', - showOnDesktop: true, - showOnMobile: false - } -} - -// https://web3auth.io/docs/sdk/pnp/web/modal/whitelabel#whitelabeling-while-modal-initialization -const openloginAdapter = new OpenloginAdapter({ - loginSettings: { - mfaLevel: 'mandatory' - }, - adapterSettings: { - uxMode: 'popup', - whiteLabel: { - name: 'Safe' - } - } -}) - -const web3AuthConfig: Web3AuthConfig = { - txServiceUrl: 'https://safe-transaction-goerli.safe.global' -} - -// Instantiate and initialize the pack -const web3AuthModalPack = new Web3AuthModalPack(web3AuthConfig) -await web3AuthModalPack.init({ options, adapters: [openloginAdapter], modalConfig }) -``` - -## Sign in to an Ethereum account - -Once your `Web3AuthModalPack` instance is created, use the `signIn()` method to start the authentication process. Usually, you call this method when the user clicks on a "Sign In" button added to your page. - -Important considerations about Web3Auth are: - -1) When you sign in with the same social account, the same Ethereum address will be returned for the same Web3Auth client ID. Web3Auth [scopes the creation of the wallet](https://web3auth.io/docs/troubleshooting/different-wallet-address-issue) (address) to the DApp, so when interacting with other DApps using Web3Auth, a different Ethereum address will be returned. This is by design and to enhanced security. - -2) If you sign in with an email and then with a social account using the same email (e.g. "Sign in with Google"), a different Ethereum address might be returned even the same email address is used. - -```typescript -// The signIn() method will return the user's Ethereum address -// The await will last until the user is authenticated, so while the UI modal is showed -const authKitSignData = await web3AuthModalPack.signIn() -``` - -The returned `authKitSignData` data contains the following props: - -```typescript -AuthKitSignInData { - eoa: string // The safe signer - safes?: string[] // The list of associated Safe addresses -} -``` - -The `signOut()` method removes the current session. - -```typescript -await web3AuthModalPack.signOut() -``` - -Call `getProvider()` to get the Ethereum provider instance. - -```typescript -web3AuthModalPack.getProvider() -``` - -We expose two methods for listening to events, `subscribe()` and `unsubscribe()`. In the `Web3AuthModalPack` case, we can listen to all the events listed [here](https://web3auth.io/docs/sdk/pnp/web/modal/initialize#subscribing-the-lifecycle-events). - -```typescript -import { ADAPTER_EVENTS } from '@web3auth/base' - -web3AuthModalPack.subscribe(ADAPTER_EVENTS.CONNECTED, () => { - console.log('User is authenticated') -}) - -web3AuthModalPack.subscribe(ADAPTER_EVENTS.DISCONNECTED, () => { - console.log('User is not authenticated') -}) -``` - -When `txServiceUrl` is provided in the `Web3AuthModalPack` instantiation, the list of associated Safe addresses will be returned as part of the `signIn()` method response. - -```typescript -const web3AuthModalPack = new Web3AuthModalPack({ - txServiceUrl: 'https://safe-transaction-goerli.safe.global' -}) -``` - -## Signing transactions using the Web3AuthModalPack and Protocol Kit - -The `Web3AuthModalPack` can be combined with the [Protocol Kit](../../protocol-kit/README.md) to connect to a Safe using the `provider` and `signer` of the currently authenticated account. - -Once connected, you can use any of the methods available in the [Protocol Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/protocol-kit#sdk-api). - -```typescript -import { ethers } from 'ethers' -import { EthersAdapter } from '@safe-global/protocol-kit' - -provider = new ethers.providers.Web3Provider(web3AuthModalPack.getProvider()) -signer = provider.getSigner() - -const ethAdapter = new EthersAdapter({ - ethers, - signerOrProvider: signer || provider -}) - -const safeSDK = await Safe.create({ - ethAdapter, - safeAddress -}) - -// Create a Safe transaction with the provided parameters -const safeTransactionData: MetaTransactionData = { - to: '0x', - data: '0x', - value: ethers.utils.parseUnits('0.0001', 'ether').toString() -} - -const safeTransaction = await safeSDK.createTransaction({ safeTransactionData }) -``` - -## Sign messages using the `Web3AuthModalPack` - -You can also sign any arbitrary message or transaction as a regular Signing Account with your favorite web3 library: - -```typescript -// Using web3 -const web3 = new Web3(web3AuthModalPack.getProvider()) - -await web3.eth.sendTransaction(tx) -await web3.eth.signTransaction(tx) -const message = 'hello world' -const address = '0x...' -await web3.eth.personal.sign(message, address) - -// Using ethers -const provider = new ethers.providers.Web3Provider(web3AuthModalPack.getProvider()) -const signer = provider.getSigner() - -await signer.sendTransaction(tx) -await signer.signTransaction(tx) -await signer.signMessage(message) -``` - -## Alternative example in `@safe-global/safe-core-sdk` - -See an [example](https://github.com/safe-global/safe-core-sdk/blob/main/packages/auth-kit/example/src/App.tsx) on how to initialize and use the Auth Kit. diff --git a/safe-core-sdk/auth-kit/reference/AuthKitBasePack.md b/safe-core-sdk/auth-kit/reference/AuthKitBasePack.md index 81125fb9..3001525f 100644 --- a/safe-core-sdk/auth-kit/reference/AuthKitBasePack.md +++ b/safe-core-sdk/auth-kit/reference/AuthKitBasePack.md @@ -20,23 +20,27 @@ class MyPack extends AuthKitBasePack { } ``` -## Abstract methods that Auth packs have to implement +## Abstract methods and properties that any pack must implement -These methods are the common interface for all the Auth packs. Check each pack's documentation to get more details. +These methods and properties are the common interface for all the Auth packs. Check each pack's documentation for more details. -### `init(options?)` +### `isAuthenticated(): boolean` + +Any pack extending the `AuthKitBasePack` class must implement the `isAuthenticated()` getter. This method returns a `boolean` indicating whether the user is authenticated. + +### `init(options?): Promise` Provides the initialization options for the required packages, classes and properties. -### `signIn(): authKitSignInData` +### `signIn(): Promise` Provides a mechanism to connect to the provider services and returns an Ethereum address that will be used as a signer along with the associated Safe addresses. -### `signOut()` +### `signOut(): Promise` Disconnects the provider services and cleans up any data related to the current user. -### `getProvider(): web3Provider` +### `getProvider(): Eip1193Provider | null` Returns a Web3 provider that can be used to interact with the blockchain (`web3.js` or `ethers.js` for example). @@ -56,19 +60,30 @@ Provides a way to unsubscribe from an event. These methods provide the functionality associated with Safe so they can be used in the implementation of the packs. -### `getAddress(): address` +### `getSafes(txServiceUrl?): Promise` + +Returns the list of Safes associated with the signer address by internally calling the `getAddress()` method. + +**Parameters** + +- `txServiceUrl`(optional): The Safe Transaction Service URL to retrieve the Safes associated with the owner (signer). + +**Returns** + +- `safes[]`: The list of Safes associated with the owner (signer). + +### `getAddress(): Promise
` Returns the Ethereum address extracted from the provider retrieved by `getProvider()`. This returns a Safe owner (signer). **Returns** -- `address`: The Ethereum address extracted from the provider. -### `getSafes(txServiceUrl): safes[]` +- `address`: The Ethereum address extracted from the provider. -Returns the list of Safes associated with the signer address by calling the `getAddress()` method internally. +### `getChainId(): Promise` -**Params** -- `txServiceUrl`: The Safe Transaction Service url to retrieve the Safes associated with the owner (signer). +Returns the chain ID of the connected network. **Returns** -- `safes[]`: The list of Safes associated with the owner (signer). + +- `chainId`: The chain ID extracted from the provider. \ No newline at end of file diff --git a/safe-core-sdk/auth-kit/reference/README.md b/safe-core-sdk/auth-kit/reference/README.md index 2e891b0f..c5ae6729 100644 --- a/safe-core-sdk/auth-kit/reference/README.md +++ b/safe-core-sdk/auth-kit/reference/README.md @@ -7,21 +7,21 @@ The [Auth Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/a To add the Auth Kit to your project, run: ```bash -yarn add @safe-global/auth-kit +yarn add @safe-global/auth-kit @web3auth/safeauth-embed ``` The Auth Kit can integrate several providers in the form of **"packs"**. A pack is a piece of code that works with the chosen provider to give Safe users access to new services. -To use each pack, the right package needs to be installed: +To use each pack, you must ensure the appropriate packages are installed. -- [Web3Auth](./Web3AuthModalPack.md#install) +- [SafeAuth](./SafeAuthPack.md#install) ## How to use a pack To start working with the packs, instantiate the main class and call the `init()` method afterwards. ```typescript -const pack = new Web3AuthModalPack(packConfig) +const pack = new SafeAuthPack(packConfig) await pack.init(packInitOptions) ``` diff --git a/safe-core-sdk/auth-kit/reference/SafeAuthPack.md b/safe-core-sdk/auth-kit/reference/SafeAuthPack.md new file mode 100644 index 00000000..c82bdfcb --- /dev/null +++ b/safe-core-sdk/auth-kit/reference/SafeAuthPack.md @@ -0,0 +1,220 @@ +# SafeAuthPack + +SafeAuth is a pluggable authentication infrastructure for web3 wallets and applications. It simplifies onboarding for mainstream and crypto native users, offering experiences tailored to their preferences. It supports all social logins, web and mobile native platforms, wallets, and other key management methods, creating a cryptographic key provider specific to the user and application. + +The `SafeAuthPack` enables using the [Web3Auth infrastructure](https://web3auth.io) with added Safe capabilities, such as retrieving the related Safe addresses for a given externally-owned account created using SafeAuth services. + +The pack helps onboard web2 users and provides an Ethereum signer address that can be used across any dapp using the different Ethereum chains. + +## Install dependencies + +To use the `SafeAuthPack`, you must install the `@safe-global/auth-kit` package and the corresponding Web3Auth one. + +```bash +yarn add @safe-global/auth-kit @web3auth/safeauth-embed +``` + +## Reference + +The `SafeAuthPack` class makes SafeAuth modal and Safe accounts work together. Create an instance of the pack and initialize it to start the interaction. + +```typescript +const safeAuthPack = new SafeAuthPack({ + txServiceUrl: 'https://safe-transaction-mainnet.safe.global', +}); +await safeAuthPack.init(safeAuthInitOptions); +``` + +### `new SafeAuthPack(safeAuthConfig)` + +**Parameters** + +- `safeAuthConfig?` - The `SafeAuthPack` class instantiation accepts the following options in its configuration: + +```typescript +SafeAuthConfig { + txServiceUrl?: string +} +``` + +- `txServiceUrl?` - The URL of the Safe Transaction Service. It's mandatory in chains where Safe doesn't provide a Transaction Service. It retrieves the Safe addresses for an EOA created using SafeAuth services. + +**Caveats** +You should always call the `init()` method afterward before interacting with the pack. + +### `init(safeAuthInitOptions)` + +The init method initializes the provided Web3Auth SDK and Safe services. It creates an embedded browser wallet within an iframe, establishing communication through the internally generated EIP-1193 provider. + +**Parameters** + +- `safeAuthInitOptions` - The options to initialize the SDK instance. + +```typescript +safeAuthInitOptions { + enableLogging?: boolean + showWidgetButton?: boolean + buttonPosition?: "bottom-left" | "top-left" | "bottom-right" | "top-right" + buildEnv?: "production" | "development" | "testing" + chainConfig?: { + blockExplorerUrl: string + logo: string + tickerName: string + ticker: string + rpcTarget: string + wcTarget?: string + chainId: string + displayName: string + isTestnet?: boolean + isErc20?: boolean + tokenAddress?: string + } +} +``` + +- `enableLogging` - Enable logging for the SDK. Defaults to `false`. +- `buildEnv` - The build environment. `production` and `testing` use `https://safe.web3auth.com`. `development` uses `http://localhost:4050`. Defaults to `production`. +- `showWidgetButton` - Show the widget button. Defaults to `true`. +- `buttonPosition` - If `showWidgetButton` is true then this prop represent the position of the widget button. Defaults to `bottom-left`. +- `chainConfig` - The chain configuration. Defaults to `ethereum` if no configuration is provided. + - `blockExplorerUrl` - Block explorer URL of the chain (e.g `https://etherscan.io`). + - `logo` - Logo URL of the base token of the chain (e.g `https://eth.svg`). + - `tickerName` - Name for ticker (e.g Ethereum). + - `ticker` - Symbol for ticker (e.g ETH). + - `rpcTarget` - The RPC URL to be used. + - `wcTarget?` - The WebSocket URL to be used. Use this or `rpcTarget`. + - `chainId` - The chain ID to be used. Should be an hex with 0x prefix (e.g 0x1 for Mainnet). + - `displayName` - The display name for the network. + - `isTestnet?` - Whether the network is Testnet or not. + - `isErc20?`- Whether the token is an ERC20 token or not. + - `tokenAddress?` - The token address for the chain. Should be an hex with 0x prefix (e.g 0x6b175474e89094c44da98b954eedeac495271d0f for DAI). + +**Caveats** + +- The list of supported chains is: + - Production: Ethereum, Polygon, BSC, Avalanche, Optimism, Celo, Arbitrum, Gnosis chain. + - Test: Goerli, Sepolia, Polygon Mumbai, BSC Testnet, Avalanche Testnet, Arbitrum Testnet, Optimism Testnet. +- Call always the `init()` method before interacting with the other methods in the pack. +- The `init()` method creates an iframe and establishes a connection with the embedded wallet domain. To remove the iframe and disconnect the connection, use the `signOut()` method. If you want to sign out and sign in again in a single-page application (SPA) fashion, avoid using `signOut({ reset: true })` as it will clean up the session, iframe, and connection. Instead, you will need to re-instantiate the pack. + +### `signIn(safeAuthSignInOptions?)` + +`signIn(safeAuthSignInOptions)` starts the authentication flow. It displays a popup that enables users to select a social authentication method (OAuth) or an email to generate the web3 wallet address. It returns the EOA and the associated Safe addresses. + +**Parameters** + +```typescript +SafeAuthSignInOptions = { + loginProvider?: "google" | "facebook" | "reddit" | "discord" | "twitch" | "apple" | "line" | "github" | "kakao" | "linkedin" | "twitter" | "weibo" | "wechat" | "email_passwordless" + login_hint?: string +} +``` + +- `loginProvider` - If specified, instead of showing the popup to choose the OAuth or email, a direct attempt to login with the specified provider will be made. + +- `login_hint` - Used to provide default mail given a `loginProvider`: + +```typescript +safeAuthPack.signIn({ + loginProvider: 'google', + login_hint: 'my-mail@safe.global', +}); +``` + +**Returns** + +An object with the derived externally-owned account address and the associated Safe addresses. + +```typescript +AuthKitSignInData { + eoa: string + safes?: string[] +} +``` + +**Caveats** + +- To get the Safe addresses, instantiate the `authKit` with the `txServiceUrl` property in the config object. Otherwise, only the EOA will be returned. +- ⚠️ This method currently returns the Safe addresses where the EOA is an owner. It doesn't create a Safe. We're investigating ways to enhance the Auth Kit and the associated flows. + +### `signOut(safeAuthSignOutOptions?)` + +Call this method to sign out the user and clean the session. + +```typescript +SafeAuthSignOutOptions { + reset: boolean; +} +``` + +**Parameters** + +- `reset` - If true, the user will be logged out from the provider, and the widget will be destroyed. Don't use this parameter if you want to log out and log in again without refreshing the browser or re-initializing the `SafeAuthPack` instance. + +### `getUserInfo()` + +Using `getUserInfo()`, you will receive the user information derived from the pack you are using. It varies depending on the provider. + +**Returns** + +The `UserInfo` object's properties vary depending on the provider. + +### `getProvider()` + +By using `getProvider()`, you will receive a standard web3 provider compatible with the EIP-1193 standard. + +**Returns** + +A EIP-1193 compatible provider. + +**Caveats** + +- You can wrap the provider using your favorite library (ethers, web3, etc.). + +### `destroy()` + +This method removes the iframe. It's useful when you need to re-instantiate the pack, for example, when changing the connected chain. + +### `subscribe(event, handler)` + +Allow to subscribe to authentication state changes. + +**Parameters** + +- `event` - The event you want to subscribe to. Currently, you can subscribe to `accountsChanged` or `chainChanged`. +- `handler` - When the event is triggered, the function will be called. + +### `unsubscribe(event, handler)` + +Allow to unsubscribe to authentication state changes. + +**Caveats** + +The `accountsChanged` event helps detect whether the user has previously signed in. This allows you to reauthenticate when the browser is refreshed by calling the `signIn` method, preventing the user from clicking the sign-in button again. + +**Parameters** + +- `event` - The event you want to unsubscribe to. +- `handler` - The function will be called when the event is triggered. + +## Usage + +Calling `init()` when your page loads or component renders is all it takes to use the Auth Kit with the `SafeAuthPack`. To start the authentication process, call `signIn()` afterward. This method returns the EOA and associated Safe addresses. + +```typescript +// Instantiate and initialize the pack +const safeAuthPack = new SafeAuthPack(safeAuthConfig); +await safeAuthPack.init(safeAuthInitOptions); + +const { eoa, safes } = await safeAuthPack.signIn(); +const userInfo = await safeAuthPack.getUserInfo(); +const web3Provider = safeAuthPack.getProvider(); + +// Subscribe to events +const handler = (event) => {}; +safeAuthPack.subscribe(packEvent, handler); +safeAuthPack.unsubscribe(packEvent, handler); + +// Sign out +await safeAuthPack.signOut(); +``` diff --git a/safe-core-sdk/auth-kit/reference/Web3AuthModalPack.md b/safe-core-sdk/auth-kit/reference/Web3AuthModalPack.md deleted file mode 100644 index 469c5c64..00000000 --- a/safe-core-sdk/auth-kit/reference/Web3AuthModalPack.md +++ /dev/null @@ -1,152 +0,0 @@ -# Web3AuthModalPack - -Web3Auth is a pluggable authentication infrastructure for Web3 wallets and applications. It simplifies onboarding for both mainstream and crypto native users, offering experiences tailored to their preferences. It supports all social logins, web and mobile native platforms, wallets, and other key management methods, creating a cryptographic key provider specific to the user and application. - -The `Web3AuthModalPack` enables the use of [Web3Auth modal SDK](https://web3auth.io/docs/sdk/pnp/web/modal) with added Safe capabilities, such as retrieving the related Safe addresses for a given externally-owned account created using Web3Auth services. - -## Install dependencies - -To use the `Web3AuthModalPack`, you need to install some extra dependencies in addition to the `@safe-global/auth-kit` package. - -```bash -yarn add @safe-global/auth-kit @web3auth/base@4.6.0 @web3auth/modal@4.6.2 -``` - -Choose the adapters to use with Web3Auth, and add them. For example, to use the [OpenLogin](https://web3auth.io/docs/sdk/pnp/web/adapters/openlogin) adapter, you must install the following dependency: - -```bash -yarn add @web3auth/openlogin-adapter@4.6.0 -``` - -Refer to the [supported adapters](https://web3auth.io/docs/sdk/pnp/web/adapters/#currently-available-wallet-adapters) in the official documentation. - -## Reference - -The `Web3AuthModalPack` class is what makes Web3Auth modal and Safe work together. Create an instance of the pack and initialize it to start the interaction. - -```typescript -const web3AuthModalPack = new Web3AuthModalPack({ - txServiceUrl: 'https://safe-transaction-mainnet.safe.global' -}) -await web3AuthModalPack.init(web3AuthModalOptions, [adapters], modalConfig) -``` - - -### new Web3AuthModalPack(web3AuthConfig) - -**Params** - -- `web3AuthConfig` - The configuration used in the instantiation of the `Web3AuthModalPack` class accepts the following options: - -```typescript -Web3AuthConfig { - txServiceUrl: string -} -``` -- `txServiceUrl` - The URL of the Safe transaction service. It is used to retrieve the Safe addresses for an externally-owned account created using Web3Auth services. It is required to use the `Web3AuthModalPack` with Safe. - -**Caveats** -You should always call the `init()` method afterwards before interacting with the pack. - -### init(web3AuthModalOptions, adapters[]?, modalConfig?) - -The init method initialize the required Web3Auth modal SDK and Safe services. It [instantiates the `Web3Auth`](https://web3auth.io/docs/quick-start?product=Plug+and+Play&sdk=Plug+and+Play+Web+Modal+SDK&platform=React#3-initialize-web3auth-for-your-preferred-blockchain) class and [configure the adapters](https://web3auth.io/docs/sdk/pnp/web/no-modal/initialize#configureadapteradapter). It calls the [`initModal`](https://web3auth.io/docs/sdk/pnp/web/modal/whitelabel#initmodal) method internally. - -It initializes as well the web3 provider we can retrieve afterwards using the `getProvider()` method. - -**Params** - -- `web3AuthModalOptions` - The options to create the `Web3Auth` [instance](https://web3auth.io/docs/sdk/pnp/web/modal/initialize#instantiating-web3auth). You can send a configuration object matching the [official one](https://web3auth.io/docs/sdk/pnp/web/modal/initialize#web3authoptions) as we passthrough the options to the `Web3Auth` instance when we instantiate it inside the pack. -- `adapters` - The adapters for the Web3Auth modal sdk. You can use any of the [supported adapters](https://web3auth.io/docs/sdk/pnp/web/adapters/). This prop accepts an array of adapters and the `Web3AuthModalPack` will call the [`configureAdapter`](https://web3auth.io/docs/sdk/pnp/web/no-modal/initialize#configureadapteradapter) method for each one of them internally. - -⚠️ Remember to add the corresponding package for each adapter (e.g `@web3auth/openlogin-adapter` for OpenLogin). - -- `modalConfig` - The configuration for the Web3Auth modal sdk. You can explore the options [here](https://web3auth.io/docs/sdk/pnp/web/modal/whitelabel#initmodal). This options are used with the `initModal` method internally. - -**Caveats** -Call always the `init()` method before interacting with the other methods in the pack. - -### signIn() - -`signIn()` calls internally the [`connect()`](https://web3auth.io/docs/sdk/pnp/web/modal/usage#connect) method from Web3Auth. It obtains a web3 provider and store it internally in the instance. Finally, retrieves the associated Safe addresses for the externally-owned account created using Web3Auth services. - -**Returns** -An object with the derived externally-owned account address and the associated safe addresses. - -```typescript -AuthKitSignInData { - eoa: string - safes?: string[] -} -``` - -**Caveats** - -- To get the Safe addresses, instantiate the authKit with the `txServiceUrl` property in the config object. Otherwise, only the eoa will be returned. -- ⚠️ This method currently returns the Safe addresses which the EOA is the owner of. It does not create a Safe. We are investigating ways to enhance the Auth Kit and the associated flows. ⚠️ - -### signOut() - -Call this method to sign out the user and clean the session. - -Internally it calls the [`logout()`](https://web3auth.io/docs/sdk/pnp/web/modal/usage#web3authlogout) method from Web3Auth and clears the web3 provider stored in the instance. - -### getUserInfo() - -Using `getUserInfo()` you will receive the user information derived from the pack you are using. It varies depending on the provider. - -Internally it calls the [`getUserInfo()`](https://web3auth.io/docs/sdk/pnp/web/modal/usage#getuserinfo) method from Web3Auth. - -**Returns** -The `UserInfo` object has properties that depend on the adapter and authentication platform and method used. - -### getProvider() - -Using `getProvider()` you will receive a regular web3 provider derived from the pack you are using. - -**Returns** -A web3 provider. - -**Caveats** -⚠️ Web3Auth with Social Logins returns a provider that allows you to sign transactions without any UI confirmations, unlike regular wallets such as Metamask ⚠️ - -### subscribe(event, handler) - -Allow to subscribe to authentication state changes. The event depends on the pack you are using so read the chosen pack documentation. - -**Params** - -- `event` - The event you want to subscribe to. The events are defined [in the documentation](https://web3auth.io/docs/sdk/pnp/web/no-modal/initialize#subscribing-the-lifecycle-events). -- `handler` - The handler function that will be called when the event is triggered. - -### unsubscribe(event, handler) - -Allow to unsubscribe to authentication state changes - -**Params** - -- `event` - The event you want to unsubscribe to. -- `handler` - The handler function that will be called when the event is triggered. - -## Usage - -Calling `init()` when your page loads or component renders is all it takes to use the Auth Kit with the `Web3AuthModalPack`. To start the authentication process, simply call `signIn()` afterwards. This method returns the EOA and associated Safe addresses. - -```typescript -// Instantiate and initialize the pack -const web3AuthModalPack = new Web3AuthModalPack(web3AuthConfig) -await web3AuthModalPack.init(web3AuthModalOptions, adapters, modalConfig) - -// Sign in -const { eoa, safes } = await web3AuthModalPack.signIn() -const userInfo = await web3AuthModalPack.getUserInfo() -const web3Provider = web3AuthModalPack.getProvider() - -// Subscribe to events -const handler = (event) => {} -web3AuthModalPack.subscribe(packEvent, handler) -web3AuthModalPack.unsubscribe(packEvent, handler) - -// Sign out -await web3AuthModalPack.signOut() -``` \ No newline at end of file From 2ff1ae032dd01334ca78967f0584f5adf93d857d Mon Sep 17 00:00:00 2001 From: Pran <15847009+heypran@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:49:25 +0100 Subject: [PATCH 6/9] fix broken links (#296) * fix broken links * fix: link name --- README.md | 2 +- safe-core-api/supported-networks.md | 1 + safe-core-sdk/protocol-kit/README.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27b5726d..782dce80 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,6 @@ This section in the documentation has relevant information and tutorials on the ## Safe{Core} API -The [Safe{Core} API](safe-core-api/available-services.md) refers to all the Safe infrastructure needed to power interfaces with all Safe account related information. This includes the Safe Transaction Service, Safe Events Service, etc. +The [Safe{Core} API](safe-core-api/supported-networks.md) refers to all the Safe infrastructure needed to power interfaces with all Safe account related information. This includes the Safe Transaction Service, Safe Events Service, etc. This section in the documentation has information related to the services architecture. diff --git a/safe-core-api/supported-networks.md b/safe-core-api/supported-networks.md index af716658..fddc685b 100644 --- a/safe-core-api/supported-networks.md +++ b/safe-core-api/supported-networks.md @@ -18,6 +18,7 @@ description: This page provides an overview of the available services | Ethereum Mainnet | [https://safe-transaction-mainnet.safe.global](https://safe-transaction-mainnet.safe.global/) | | Gnosis Chain | [https://safe-transaction-gnosis-chain.safe.global](https://safe-transaction-gnosis-chain.safe.global/) | | Goerli | [https://safe-transaction-goerli.safe.global](https://safe-transaction-goerli.safe.global/) | +| Sepolia | [https://safe-transaction-sepolia.safe.global](https://safe-transaction-sepolia.safe.global/) | | Optimism | [https://safe-transaction-optimism.safe.global](https://safe-transaction-optimism.safe.global/) | | Polygon | [https://safe-transaction-polygon.safe.global](https://safe-transaction-polygon.safe.global/) | | Polygon zkEVM | [https://safe-transaction-zkevm.safe.global](https://safe-transaction-zkevm.safe.global/) | diff --git a/safe-core-sdk/protocol-kit/README.md b/safe-core-sdk/protocol-kit/README.md index d0da795e..e39b9099 100644 --- a/safe-core-sdk/protocol-kit/README.md +++ b/safe-core-sdk/protocol-kit/README.md @@ -90,7 +90,7 @@ const ethAdapterOwner1 = new EthersAdapter({ The [API Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/api-kit) consumes the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service). To use this library, create a new instance of the `SafeApiKit` class, imported from `@safe-global/api-kit`. In chains where Safe provides a Transaction Service, it's enough to specify the `chainId.` You can specify your own service using the optional `txServiceUrl` parameter. -You will be using Goerli for this tutorial, however, you can also get [service URLs for different networks](../../safe-core-api/available-services.md). +You will be using Goerli for this tutorial, however, you can also get [service URLs for different networks](../../safe-core-api/supported-networks.md). ```tsx import SafeApiKit from '@safe-global/api-kit' From da1a5105593d723698fa5a366cbfcd0b71218262 Mon Sep 17 00:00:00 2001 From: Tanay Pant Date: Mon, 4 Dec 2023 15:52:52 +0100 Subject: [PATCH 7/9] Minor fixes --- safe-core-api/supported-networks.md | 2 +- safe-core-sdk/protocol-kit/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/safe-core-api/supported-networks.md b/safe-core-api/supported-networks.md index fddc685b..b91d974f 100644 --- a/safe-core-api/supported-networks.md +++ b/safe-core-api/supported-networks.md @@ -18,8 +18,8 @@ description: This page provides an overview of the available services | Ethereum Mainnet | [https://safe-transaction-mainnet.safe.global](https://safe-transaction-mainnet.safe.global/) | | Gnosis Chain | [https://safe-transaction-gnosis-chain.safe.global](https://safe-transaction-gnosis-chain.safe.global/) | | Goerli | [https://safe-transaction-goerli.safe.global](https://safe-transaction-goerli.safe.global/) | -| Sepolia | [https://safe-transaction-sepolia.safe.global](https://safe-transaction-sepolia.safe.global/) | | Optimism | [https://safe-transaction-optimism.safe.global](https://safe-transaction-optimism.safe.global/) | | Polygon | [https://safe-transaction-polygon.safe.global](https://safe-transaction-polygon.safe.global/) | | Polygon zkEVM | [https://safe-transaction-zkevm.safe.global](https://safe-transaction-zkevm.safe.global/) | +| Sepolia | [https://safe-transaction-sepolia.safe.global](https://safe-transaction-sepolia.safe.global/) | | zkSync Era Mainnet | [https://safe-transaction-zksync.safe.global](https://safe-transaction-zksync.safe.global/) | diff --git a/safe-core-sdk/protocol-kit/README.md b/safe-core-sdk/protocol-kit/README.md index e39b9099..6bc5bd7f 100644 --- a/safe-core-sdk/protocol-kit/README.md +++ b/safe-core-sdk/protocol-kit/README.md @@ -6,7 +6,7 @@ The [Protocol Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packag In this quickstart guide, you will create a 2 of 3 multi-sig Safe and propose and execute a transaction to send some ETH out of this Safe. -For a more detailed guide, including how to integrate with `web3.js`` and more Safe transaction configuration options, see [Guide: Integrating the Protocol Kit and API Kit](https://github.com/safe-global/safe-core-sdk/blob/main/guides/integrating-the-safe-core-sdk.md) and [Protocol Kit Reference](https://github.com/safe-global/safe-core-sdk/tree/main/packages/protocol-kit#sdk-api). +For a more detailed guide, including how to integrate with web3.js and more Safe transaction configuration options, see [Guide: Integrating the Protocol Kit and API Kit](https://github.com/safe-global/safe-core-sdk/blob/main/guides/integrating-the-safe-core-sdk.md) and [Protocol Kit Reference](https://github.com/safe-global/safe-core-sdk/tree/main/packages/protocol-kit#sdk-api). ### Prerequisites From 01bbe4fbc594895194d28799dcec182a8db25014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20P=C3=A9rez=20V=C3=A1zquez?= Date: Mon, 4 Dec 2023 16:39:58 +0100 Subject: [PATCH 8/9] chore: Improve auth-kit docs (#298) --- safe-core-sdk/auth-kit/guides/safe-auth.md | 18 ++++++---------- .../auth-kit/reference/SafeAuthPack.md | 21 ++++++++----------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/safe-core-sdk/auth-kit/guides/safe-auth.md b/safe-core-sdk/auth-kit/guides/safe-auth.md index 7ed368fa..c1365402 100644 --- a/safe-core-sdk/auth-kit/guides/safe-auth.md +++ b/safe-core-sdk/auth-kit/guides/safe-auth.md @@ -32,23 +32,19 @@ import { SafeAuthInitOptions, } from '@safe-global/auth-kit' -const safeAuthConfig: SafeAuthConfig = { - txServiceUrl: 'https://safe-transaction-mainnet.safe.global', -} const safeAuthInitOptions: SafeAuthInitOptions = { enableLogging: true, showWidgetButton: false, chainConfig: { - blockExplorerUrl: 'https://etherscan.io', chainId: '0x1', - displayName: 'Main Ethereum Network', - logo: 'eth.svg', - rpcTarget: `${rpcUrl}`, - ticker: 'ETH', - tickerName: 'Ethereum', + rpcTarget: `${rpcUrl}` }, } +// You can also pass the SafeAuthConfig as a parameter to the SafeAuthPack constructor if you are using a custom txServiceUrl domain +// e.g. const safeAuthConfig: SafeAuthConfig = { +// txServiceUrl: 'https://safe-transaction-mainnet.safe.global' +// } const safeAuthPack = new SafeAuthPack(safeAuthConfig) await safeAuthPack.init(safeAuthInitOptions) ``` @@ -100,9 +96,7 @@ safeAuthPack.unsubscribe('accountsChanged', accountChangedHandler) The `SafeAuthPack` instantiation will return the list of associated Safe addresses as part of the response from the `signIn()` method when the `txServiceUrl` is provided. ```typescript -const safeAuthPack = new SafeAuthPack({ - txServiceUrl: 'https://safe-transaction-mainnet.safe.global', -}) +const safeAuthPack = new SafeAuthPack() ``` ## Signing and executing transactions using the SafeAuthPack and Protocol Kit diff --git a/safe-core-sdk/auth-kit/reference/SafeAuthPack.md b/safe-core-sdk/auth-kit/reference/SafeAuthPack.md index c82bdfcb..eaed9dfa 100644 --- a/safe-core-sdk/auth-kit/reference/SafeAuthPack.md +++ b/safe-core-sdk/auth-kit/reference/SafeAuthPack.md @@ -57,17 +57,15 @@ safeAuthInitOptions { buttonPosition?: "bottom-left" | "top-left" | "bottom-right" | "top-right" buildEnv?: "production" | "development" | "testing" chainConfig?: { - blockExplorerUrl: string - logo: string - tickerName: string - ticker: string + blockExplorerUrl?: string + logo?: string + tickerName?: string + ticker?: string rpcTarget: string wcTarget?: string chainId: string - displayName: string + displayName?: string isTestnet?: boolean - isErc20?: boolean - tokenAddress?: string } } ``` @@ -77,17 +75,16 @@ safeAuthInitOptions { - `showWidgetButton` - Show the widget button. Defaults to `true`. - `buttonPosition` - If `showWidgetButton` is true then this prop represent the position of the widget button. Defaults to `bottom-left`. - `chainConfig` - The chain configuration. Defaults to `ethereum` if no configuration is provided. + - `chainId` - The chain ID to be used. Should be an hex with 0x prefix (e.g 0x1 for Mainnet). + - `rpcTarget` - The RPC URL to be used. + The following properties are optional: - `blockExplorerUrl` - Block explorer URL of the chain (e.g `https://etherscan.io`). - `logo` - Logo URL of the base token of the chain (e.g `https://eth.svg`). - `tickerName` - Name for ticker (e.g Ethereum). - `ticker` - Symbol for ticker (e.g ETH). - - `rpcTarget` - The RPC URL to be used. - `wcTarget?` - The WebSocket URL to be used. Use this or `rpcTarget`. - - `chainId` - The chain ID to be used. Should be an hex with 0x prefix (e.g 0x1 for Mainnet). - `displayName` - The display name for the network. - `isTestnet?` - Whether the network is Testnet or not. - - `isErc20?`- Whether the token is an ERC20 token or not. - - `tokenAddress?` - The token address for the chain. Should be an hex with 0x prefix (e.g 0x6b175474e89094c44da98b954eedeac495271d0f for DAI). **Caveats** @@ -134,7 +131,7 @@ AuthKitSignInData { **Caveats** -- To get the Safe addresses, instantiate the `authKit` with the `txServiceUrl` property in the config object. Otherwise, only the EOA will be returned. +- The `txServiceUrl` should be used with custom Transaction services endpoints. If empty, the default Safe Transaction Service domain will be used if it has been deployed in the corresponding chain. - ⚠️ This method currently returns the Safe addresses where the EOA is an owner. It doesn't create a Safe. We're investigating ways to enhance the Auth Kit and the associated flows. ### `signOut(safeAuthSignOutOptions?)` From 6afed64f277f6d87dac9ff6ff10a7a11d17e379a Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 5 Dec 2023 17:44:51 +0100 Subject: [PATCH 9/9] Fix generate supported networks (#299) * Fix generate supported networks * Generate supported networks .md files * Edit vocab * Add toruscan as deprecated block explorer --- .github/scripts/generateSupportedNetworks.js | 30 +++++--- .github/styles/Vocab/default/accept.txt | 2 +- .../workflows/generate-supported-networks.yml | 19 ++--- package.json | 3 + .../supported-networks/v1.3.0.md | 76 +++++++++---------- .../supported-networks/v1.4.1.md | 18 ++--- 6 files changed, 74 insertions(+), 74 deletions(-) diff --git a/.github/scripts/generateSupportedNetworks.js b/.github/scripts/generateSupportedNetworks.js index 3a84b9ce..055deb34 100644 --- a/.github/scripts/generateSupportedNetworks.js +++ b/.github/scripts/generateSupportedNetworks.js @@ -1,7 +1,11 @@ +// This script generates the supported networks page from the safe-deployments repo. +// It clones the repo, reads the JSON files, and generates the markdown files as well as a _meta.json file for nextra. + const shell = require('shelljs') const fs = require('fs') const path = require('path') +// Explore a given directory recursively and return all the file paths const walkPath = dir => { let results = [] const list = fs.readdirSync(dir) @@ -18,16 +22,14 @@ const walkPath = dir => { return results } -const deduplicate = () => [ - (acc, curr) => { - if (acc.includes(curr)) { - return acc - } +// Reduce function to deduplicate an array +const deduplicate = (acc, curr) => { + if (acc.includes(curr)) { + return acc + } - return [...acc, curr] - }, - [] -] + return [...acc, curr] +} const supportedNetworksPath = './safe-smart-account/supported-networks' @@ -63,7 +65,7 @@ const generateSupportedNetworks = async () => { const versions = contracts .flat() .map(c => c.version) - .reduce(...deduplicate()) + .reduce(deduplicate, []) .reverse() shell.mkdir(supportedNetworksPath) @@ -102,7 +104,8 @@ ${_contracts .map( c => `- \`${c.name}.sol\`: ${ - c.blockExplorerUrl == null || deprecatedBlockExplorers.includes(c.blockExplorerUrl) + c.blockExplorerUrl == null || + deprecatedBlockExplorers.includes(c.blockExplorerUrl) ? c.address : `[${c.address}](${c.blockExplorerUrl}/address/${c.address})` }` @@ -128,6 +131,7 @@ const deprecatedBlockExplorers = [ 'https://stardust-explorer.metis.io', 'https://blockexplorer.rinkeby.boba.network', 'https://blockexplorer.bobabeam.boba.network', + 'https://blockexplorer.avax.boba.network', 'https://rabbit.analogscan.com', 'https://explorer.eurus.network', 'https://testnetexplorer.eurus.network', @@ -137,4 +141,6 @@ const deprecatedBlockExplorers = [ 'https://evm.explorer.canto.io', 'https://explorer.autobahn.network', 'https://explorer.cascadia.foundation', -] + 'https://testnet.torusscan.com', + 'https://testnet.toruscan.com' +] \ No newline at end of file diff --git a/.github/styles/Vocab/default/accept.txt b/.github/styles/Vocab/default/accept.txt index a8189683..f08e3dbe 100644 --- a/.github/styles/Vocab/default/accept.txt +++ b/.github/styles/Vocab/default/accept.txt @@ -37,6 +37,7 @@ Cronos Crossbell DAO Darwinia +Devnet EIP ERC ETH @@ -73,7 +74,6 @@ LUKSO Lightlink Linea middleware -MainNet Mainnet Mandala Mantle diff --git a/.github/workflows/generate-supported-networks.yml b/.github/workflows/generate-supported-networks.yml index accabbe9..d4fcb9a8 100644 --- a/.github/workflows/generate-supported-networks.yml +++ b/.github/workflows/generate-supported-networks.yml @@ -13,22 +13,13 @@ jobs: uses: actions/setup-node@v2 with: node-version: '20.x' - cache: 'yarn' - cache-dependency-path: ./yarn.lock - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache + - uses: pnpm/action-setup@v2 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + version: 8 + - name: Install dependencies + run: pnpm install - name: Generate supported networks - run: node ./.github/scripts/generateSupportedNetworks.js + run: pnpm generate-supported-networks - uses: actions/checkout@v4 - name: Create Pull Request uses: peter-evans/create-pull-request@v5 diff --git a/package.json b/package.json index 038d73cb..5f4a7f10 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,7 @@ { + "scripts": { + "generate-supported-networks": "node .github/scripts/generateSupportedNetworks.js" + }, "dependencies": { "node-fetch": "^3.3.2", "shelljs": "^0.8.5" diff --git a/safe-smart-account/supported-networks/v1.3.0.md b/safe-smart-account/supported-networks/v1.3.0.md index 2e0700be..1068487f 100644 --- a/safe-smart-account/supported-networks/v1.3.0.md +++ b/safe-smart-account/supported-networks/v1.3.0.md @@ -128,15 +128,15 @@ This network's chain ID is 18. This network's chain ID is 25. -- `compatibility_fallback_handler.sol`: [0x017062a1dE2FE6b99BE3d9d37841FeD19F573804](https://cronoscan.com/address/0x017062a1dE2FE6b99BE3d9d37841FeD19F573804) -- `create_call.sol`: [0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d](https://cronoscan.com/address/0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d) -- `gnosis_safe.sol`: [0x69f4D1788e39c87893C980c06EdF4b7f686e2938](https://cronoscan.com/address/0x69f4D1788e39c87893C980c06EdF4b7f686e2938) -- `gnosis_safe_l2.sol`: [0xfb1bffC9d739B8D520DaF37dF666da4C687191EA](https://cronoscan.com/address/0xfb1bffC9d739B8D520DaF37dF666da4C687191EA) -- `multi_send.sol`: [0x998739BFdAAdde7C933B942a68053933098f9EDa](https://cronoscan.com/address/0x998739BFdAAdde7C933B942a68053933098f9EDa) -- `multi_send_call_only.sol`: [0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B](https://cronoscan.com/address/0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B) -- `proxy_factory.sol`: [0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC](https://cronoscan.com/address/0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) -- `sign_message_lib.sol`: [0x98FFBBF51bb33A056B08ddf711f289936AafF717](https://cronoscan.com/address/0x98FFBBF51bb33A056B08ddf711f289936AafF717) -- `simulate_tx_accessor.sol`: [0x727a77a074D1E6c4530e814F89E618a3298FC044](https://cronoscan.com/address/0x727a77a074D1E6c4530e814F89E618a3298FC044) +- `compatibility_fallback_handler.sol`: [0x017062a1dE2FE6b99BE3d9d37841FeD19F573804](https://explorer.cronos.org/address/0x017062a1dE2FE6b99BE3d9d37841FeD19F573804) +- `create_call.sol`: [0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d](https://explorer.cronos.org/address/0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d) +- `gnosis_safe.sol`: [0x69f4D1788e39c87893C980c06EdF4b7f686e2938](https://explorer.cronos.org/address/0x69f4D1788e39c87893C980c06EdF4b7f686e2938) +- `gnosis_safe_l2.sol`: [0xfb1bffC9d739B8D520DaF37dF666da4C687191EA](https://explorer.cronos.org/address/0xfb1bffC9d739B8D520DaF37dF666da4C687191EA) +- `multi_send.sol`: [0x998739BFdAAdde7C933B942a68053933098f9EDa](https://explorer.cronos.org/address/0x998739BFdAAdde7C933B942a68053933098f9EDa) +- `multi_send_call_only.sol`: [0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B](https://explorer.cronos.org/address/0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B) +- `proxy_factory.sol`: [0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC](https://explorer.cronos.org/address/0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) +- `sign_message_lib.sol`: [0x98FFBBF51bb33A056B08ddf711f289936AafF717](https://explorer.cronos.org/address/0x98FFBBF51bb33A056B08ddf711f289936AafF717) +- `simulate_tx_accessor.sol`: [0x727a77a074D1E6c4530e814F89E618a3298FC044](https://explorer.cronos.org/address/0x727a77a074D1E6c4530e814F89E618a3298FC044) ### Boba Network Rinkeby Testnet @@ -1806,15 +1806,15 @@ This network's chain ID is 43114. This network's chain ID is 43288. -- `compatibility_fallback_handler.sol`: [0x017062a1dE2FE6b99BE3d9d37841FeD19F573804](https://blockexplorer.avax.boba.network/address/0x017062a1dE2FE6b99BE3d9d37841FeD19F573804) -- `create_call.sol`: [0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d](https://blockexplorer.avax.boba.network/address/0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d) -- `gnosis_safe.sol`: [0x69f4D1788e39c87893C980c06EdF4b7f686e2938](https://blockexplorer.avax.boba.network/address/0x69f4D1788e39c87893C980c06EdF4b7f686e2938) -- `gnosis_safe_l2.sol`: [0xfb1bffC9d739B8D520DaF37dF666da4C687191EA](https://blockexplorer.avax.boba.network/address/0xfb1bffC9d739B8D520DaF37dF666da4C687191EA) -- `multi_send.sol`: [0x998739BFdAAdde7C933B942a68053933098f9EDa](https://blockexplorer.avax.boba.network/address/0x998739BFdAAdde7C933B942a68053933098f9EDa) -- `multi_send_call_only.sol`: [0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B](https://blockexplorer.avax.boba.network/address/0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B) -- `proxy_factory.sol`: [0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC](https://blockexplorer.avax.boba.network/address/0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) -- `sign_message_lib.sol`: [0x98FFBBF51bb33A056B08ddf711f289936AafF717](https://blockexplorer.avax.boba.network/address/0x98FFBBF51bb33A056B08ddf711f289936AafF717) -- `simulate_tx_accessor.sol`: [0x727a77a074D1E6c4530e814F89E618a3298FC044](https://blockexplorer.avax.boba.network/address/0x727a77a074D1E6c4530e814F89E618a3298FC044) +- `compatibility_fallback_handler.sol`: 0x017062a1dE2FE6b99BE3d9d37841FeD19F573804 +- `create_call.sol`: 0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d +- `gnosis_safe.sol`: 0x69f4D1788e39c87893C980c06EdF4b7f686e2938 +- `gnosis_safe_l2.sol`: 0xfb1bffC9d739B8D520DaF37dF666da4C687191EA +- `multi_send.sol`: 0x998739BFdAAdde7C933B942a68053933098f9EDa +- `multi_send_call_only.sol`: 0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B +- `proxy_factory.sol`: 0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC +- `sign_message_lib.sol`: 0x98FFBBF51bb33A056B08ddf711f289936AafF717 +- `simulate_tx_accessor.sol`: 0x727a77a074D1E6c4530e814F89E618a3298FC044 ### Celo Alfajores Testnet @@ -2119,15 +2119,15 @@ This network's chain ID is 421614. This network's chain ID is 534351. -- `compatibility_fallback_handler.sol`: [0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4](https://sepolia.scrollscan.dev/address/0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4) -- `create_call.sol`: [0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4](https://sepolia.scrollscan.dev/address/0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4) -- `gnosis_safe.sol`: [0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552](https://sepolia.scrollscan.dev/address/0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552) -- `gnosis_safe_l2.sol`: [0x3E5c63644E683549055b9Be8653de26E0B4CD36E](https://sepolia.scrollscan.dev/address/0x3E5c63644E683549055b9Be8653de26E0B4CD36E) -- `multi_send.sol`: [0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761](https://sepolia.scrollscan.dev/address/0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761) -- `multi_send_call_only.sol`: [0x40A2aCCbd92BCA938b02010E17A5b8929b49130D](https://sepolia.scrollscan.dev/address/0x40A2aCCbd92BCA938b02010E17A5b8929b49130D) -- `proxy_factory.sol`: [0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2](https://sepolia.scrollscan.dev/address/0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2) -- `sign_message_lib.sol`: [0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2](https://sepolia.scrollscan.dev/address/0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2) -- `simulate_tx_accessor.sol`: [0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da](https://sepolia.scrollscan.dev/address/0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da) +- `compatibility_fallback_handler.sol`: [0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4](https://sepolia.scrollscan.com/address/0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4) +- `create_call.sol`: [0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4](https://sepolia.scrollscan.com/address/0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4) +- `gnosis_safe.sol`: [0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552](https://sepolia.scrollscan.com/address/0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552) +- `gnosis_safe_l2.sol`: [0x3E5c63644E683549055b9Be8653de26E0B4CD36E](https://sepolia.scrollscan.com/address/0x3E5c63644E683549055b9Be8653de26E0B4CD36E) +- `multi_send.sol`: [0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761](https://sepolia.scrollscan.com/address/0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761) +- `multi_send_call_only.sol`: [0x40A2aCCbd92BCA938b02010E17A5b8929b49130D](https://sepolia.scrollscan.com/address/0x40A2aCCbd92BCA938b02010E17A5b8929b49130D) +- `proxy_factory.sol`: [0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2](https://sepolia.scrollscan.com/address/0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2) +- `sign_message_lib.sol`: [0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2](https://sepolia.scrollscan.com/address/0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2) +- `simulate_tx_accessor.sol`: [0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da](https://sepolia.scrollscan.com/address/0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da) ### Scroll @@ -2220,22 +2220,22 @@ This network's chain ID is 222000222. - `simulate_tx_accessor.sol`: [0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da](https://subnets-test.avax.network/meld/address/0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da) -### Neon EVM DevNet +### Neon EVM Devnet This network's chain ID is 245022926. -- `compatibility_fallback_handler.sol`: [0x017062a1dE2FE6b99BE3d9d37841FeD19F573804](https://devnet.explorer.neon-labs.org/address/0x017062a1dE2FE6b99BE3d9d37841FeD19F573804) -- `create_call.sol`: [0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d](https://devnet.explorer.neon-labs.org/address/0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d) -- `gnosis_safe.sol`: [0x69f4D1788e39c87893C980c06EdF4b7f686e2938](https://devnet.explorer.neon-labs.org/address/0x69f4D1788e39c87893C980c06EdF4b7f686e2938) -- `gnosis_safe_l2.sol`: [0xfb1bffC9d739B8D520DaF37dF666da4C687191EA](https://devnet.explorer.neon-labs.org/address/0xfb1bffC9d739B8D520DaF37dF666da4C687191EA) -- `multi_send.sol`: [0x998739BFdAAdde7C933B942a68053933098f9EDa](https://devnet.explorer.neon-labs.org/address/0x998739BFdAAdde7C933B942a68053933098f9EDa) -- `multi_send_call_only.sol`: [0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B](https://devnet.explorer.neon-labs.org/address/0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B) -- `proxy_factory.sol`: [0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC](https://devnet.explorer.neon-labs.org/address/0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) -- `sign_message_lib.sol`: [0x98FFBBF51bb33A056B08ddf711f289936AafF717](https://devnet.explorer.neon-labs.org/address/0x98FFBBF51bb33A056B08ddf711f289936AafF717) -- `simulate_tx_accessor.sol`: [0x727a77a074D1E6c4530e814F89E618a3298FC044](https://devnet.explorer.neon-labs.org/address/0x727a77a074D1E6c4530e814F89E618a3298FC044) +- `compatibility_fallback_handler.sol`: [0x017062a1dE2FE6b99BE3d9d37841FeD19F573804](https://devnet.neonscan.org/address/0x017062a1dE2FE6b99BE3d9d37841FeD19F573804) +- `create_call.sol`: [0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d](https://devnet.neonscan.org/address/0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d) +- `gnosis_safe.sol`: [0x69f4D1788e39c87893C980c06EdF4b7f686e2938](https://devnet.neonscan.org/address/0x69f4D1788e39c87893C980c06EdF4b7f686e2938) +- `gnosis_safe_l2.sol`: [0xfb1bffC9d739B8D520DaF37dF666da4C687191EA](https://devnet.neonscan.org/address/0xfb1bffC9d739B8D520DaF37dF666da4C687191EA) +- `multi_send.sol`: [0x998739BFdAAdde7C933B942a68053933098f9EDa](https://devnet.neonscan.org/address/0x998739BFdAAdde7C933B942a68053933098f9EDa) +- `multi_send_call_only.sol`: [0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B](https://devnet.neonscan.org/address/0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B) +- `proxy_factory.sol`: [0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC](https://devnet.neonscan.org/address/0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) +- `sign_message_lib.sol`: [0x98FFBBF51bb33A056B08ddf711f289936AafF717](https://devnet.neonscan.org/address/0x98FFBBF51bb33A056B08ddf711f289936AafF717) +- `simulate_tx_accessor.sol`: [0x727a77a074D1E6c4530e814F89E618a3298FC044](https://devnet.neonscan.org/address/0x727a77a074D1E6c4530e814F89E618a3298FC044) -### Neon EVM MainNet +### Neon EVM Mainnet This network's chain ID is 245022934. diff --git a/safe-smart-account/supported-networks/v1.4.1.md b/safe-smart-account/supported-networks/v1.4.1.md index 4aafa3fa..8cf10c88 100644 --- a/safe-smart-account/supported-networks/v1.4.1.md +++ b/safe-smart-account/supported-networks/v1.4.1.md @@ -98,15 +98,15 @@ This network's chain ID is 1442. This network's chain ID is 8194. -- `compatibility_fallback_handler.sol`: [0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99](https://testnet.torusscan.com/address/0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99) -- `create_call.sol`: [0x9b35Af71d77eaf8d7e40252370304687390A1A52](https://testnet.torusscan.com/address/0x9b35Af71d77eaf8d7e40252370304687390A1A52) -- `multi_send.sol`: [0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526](https://testnet.torusscan.com/address/0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526) -- `multi_send_call_only.sol`: [0x9641d764fc13c8B624c04430C7356C1C7C8102e2](https://testnet.torusscan.com/address/0x9641d764fc13c8B624c04430C7356C1C7C8102e2) -- `safe.sol`: [0x41675C099F32341bf84BFc5382aF534df5C7461a](https://testnet.torusscan.com/address/0x41675C099F32341bf84BFc5382aF534df5C7461a) -- `safe_l2.sol`: [0x29fcB43b46531BcA003ddC8FCB67FFE91900C762](https://testnet.torusscan.com/address/0x29fcB43b46531BcA003ddC8FCB67FFE91900C762) -- `safe_proxy_factory.sol`: [0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67](https://testnet.torusscan.com/address/0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67) -- `sign_message_lib.sol`: [0xd53cd0aB83D845Ac265BE939c57F53AD838012c9](https://testnet.torusscan.com/address/0xd53cd0aB83D845Ac265BE939c57F53AD838012c9) -- `simulate_tx_accessor.sol`: [0x3d4BA2E0884aa488718476ca2FB8Efc291A46199](https://testnet.torusscan.com/address/0x3d4BA2E0884aa488718476ca2FB8Efc291A46199) +- `compatibility_fallback_handler.sol`: [0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99](https://testnet.toruscan.com/address/0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99) +- `create_call.sol`: [0x9b35Af71d77eaf8d7e40252370304687390A1A52](https://testnet.toruscan.com/address/0x9b35Af71d77eaf8d7e40252370304687390A1A52) +- `multi_send.sol`: [0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526](https://testnet.toruscan.com/address/0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526) +- `multi_send_call_only.sol`: [0x9641d764fc13c8B624c04430C7356C1C7C8102e2](https://testnet.toruscan.com/address/0x9641d764fc13c8B624c04430C7356C1C7C8102e2) +- `safe.sol`: [0x41675C099F32341bf84BFc5382aF534df5C7461a](https://testnet.toruscan.com/address/0x41675C099F32341bf84BFc5382aF534df5C7461a) +- `safe_l2.sol`: [0x29fcB43b46531BcA003ddC8FCB67FFE91900C762](https://testnet.toruscan.com/address/0x29fcB43b46531BcA003ddC8FCB67FFE91900C762) +- `safe_proxy_factory.sol`: [0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67](https://testnet.toruscan.com/address/0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67) +- `sign_message_lib.sol`: [0xd53cd0aB83D845Ac265BE939c57F53AD838012c9](https://testnet.toruscan.com/address/0xd53cd0aB83D845Ac265BE939c57F53AD838012c9) +- `simulate_tx_accessor.sol`: [0x3d4BA2E0884aa488718476ca2FB8Efc291A46199](https://testnet.toruscan.com/address/0x3d4BA2E0884aa488718476ca2FB8Efc291A46199) ### Holesky