Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Multichain): Multichain Safes with same address #4120

Merged
merged 86 commits into from
Oct 14, 2024
Merged

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Aug 28, 2024

What is this Epic about?

This epic enables users to create Safes with the same address across L1 and L2 networks.
This involves

  • a new Safe creation flow that creates Safes with the correct masterCopy (L1 or L2) during the setup call.
  • a new migration for incompatible L1 Safes on L2 chains
  • design changes to the sidebar to group Safes by address and then by chains
  • a new network selector which allows deploying a opened Safe on a new chain and to switch between deployed chains
  • Action to re-deploy a Safe with the same address

How to test it

See the individual users stories acceptance criteria

Screenshots

tbd

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

- Sidebar groups Safes with the same address and shows them first.
- New designs for safe groups
Copy link

github-actions bot commented Aug 28, 2024

Copy link

github-actions bot commented Aug 28, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Aug 28, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 988.17 KB (🟡 +26.93 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seventeen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 511 B (🟢 -24.37 KB) 988.67 KB
/address-book 26.09 KB (🟡 +5 B) 1014.26 KB
/apps/open 55.18 KB (-1 B) 1.02 MB
/balances 29.42 KB (🟢 -1.52 KB) 1017.59 KB
/balances/nfts 19.18 KB (-1 B) 1007.35 KB
/home 57.33 KB (🟢 -931 B) 1.02 MB
/new-safe/advanced-create 36.48 KB (🟡 +1.39 KB) 1 MB
/new-safe/create 35.73 KB (🟡 +1.38 KB) 1023.9 KB
/new-safe/load 16.41 KB (🟡 +8 B) 1004.58 KB
/settings/modules 9.82 KB (🟡 +38 B) 997.99 KB
/settings/notifications 27.03 KB (-2 B) 1015.2 KB
/settings/setup 35.98 KB (🟡 +5 B) 1 MB
/transactions 73.53 KB (-1 B) 1.04 MB
/transactions/history 73.5 KB (-1 B) 1.04 MB
/transactions/tx 21.08 KB (-2 B) 1009.25 KB
/welcome 6.8 KB (🟢 -1 B) 994.97 KB
/welcome/accounts 379 B (🟢 -1 B) 988.54 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Aug 28, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.69% (-0.83% 🔻)
13494/18313
🔴 Branches
51.5% (-1.34% 🔻)
3279/6367
🔴 Functions
57.16% (-1.53% 🔻)
1963/3434
🟡 Lines
75.39% (-0.83% 🔻)
12269/16273
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / index.ts
83.33% 100% 66.67% 89.47%
🟢
... / safeOverviews.ts
100% 100% 100% 100%
🟡
... / ofac.ts
67.86% 50% 75% 68.18%
🟢
... / safePass.ts
90.91% 75% 50% 88.89%
🟢
... / utils.ts
90.54% 80% 90% 94.83%
🟢
... / useSafeCreationData.ts
98.72% 96.3% 100% 100%
🟢
... / useCompatibleNetworks.ts
100% 100% 100% 100%
🔴
... / index.tsx
38.1% 0% 0% 39.02%
🟢
... / MigrateToL2Information.tsx
80% 0% 0% 100%
🟢
... / index.tsx
100% 60% 100% 100%
🔴
... / address-book.ts
28.57% 0% 0% 30.77%
🔴
... / useAllSafesGrouped.ts
28.57% 0% 0% 27.78%
🔴
... / index.tsx
33.73% 0% 0% 35.9%
🔴
... / index.tsx
40.74% 0% 0% 50%
🟡
... / useIsCounterfactualSafe.ts
55.56% 100% 0% 71.43%
🔴
... / useGetHref.ts
37.5% 0% 0% 42.86%
🔴
... / MultiAccountItem.tsx
37.18% 0% 0% 42.03%
🟡
... / SubAccountItem.tsx
59.09% 0% 0% 63.41%
🟡
... / AddNetworkButton.tsx
63.64% 0% 0% 70%
🔴
... / MultiAccountContextMenu.tsx
50% 28.57% 11.11% 52.78%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 src/store/common.ts
88.89% (-11.11% 🔻)
50%
75% (-25% 🔻)
84.62% (-15.38% 🔻)
🟡
... / transaction-guards.ts
69.91% (+0.17% 🔼)
34.52% (-2.4% 🔻)
68.75% (+0.42% 🔼)
70.73% (-0.38% 🔻)
🟢
... / deployments.ts
85.48% (-14.52% 🔻)
86.67% (-13.33% 🔻)
81.25% (-18.75% 🔻)
87.23% (-12.77% 🔻)
🟡
... / transaction-calldata.ts
65% (-33.33% 🔻)
0% (-100% 🔻)
54.55% (-45.45% 🔻)
66.67% (-33.33% 🔻)
🟡
... / addedSafesSlice.ts
65.52% (+2.36% 🔼)
75% (+25% 🔼)
33.33% (-8.33% 🔻)
68.18% (+0.44% 🔼)
🔴
... / undeployedSafesSlice.ts
38.46% (+1.32% 🔼)
33.33%
30% (-7.5% 🔻)
42.86% (-1.14% 🔻)
🟢
... / safeCoreSDK.ts
92.31% (-3.61% 🔻)
84.62% (-7.05% 🔻)
100%
93.48% (-4.2% 🔻)
🔴
... / SafeTxProvider.tsx
28.95% (+0.38% 🔼)
0%
40% (-4.44% 🔻)
29.41% (+0.25% 🔼)
🔴
... / index.tsx
50% (-0.85% 🔻)
3.45% 8.33%
53.06% (-0.94% 🔻)
🟢
... / index.tsx
91.67% (+0.49% 🔼)
78.38% (-1.62% 🔻)
100% 100%
🟢
... / index.tsx
95.45% (+1.7% 🔼)
76.92% (-4.9% 🔻)
100% 100%
🟢
... / index.tsx
86.05% (-1.45% 🔻)
37.14% (-1.09% 🔻)
42.86% (-7.14% 🔻)
85.37% (-1.48% 🔻)
🟢
... / index.tsx
100%
62.5% (-4.17% 🔻)
100% 100%
🟢
... / index.tsx
90% (-10% 🔻)
57.14%
50% (-50% 🔻)
88.89% (-11.11% 🔻)
🟢
... / useLoadBalances.ts
91.11% (-2.22% 🔻)
66.67% 100% 95%
🟢
... / utils.ts
90.32% (-9.68% 🔻)
70% (-30% 🔻)
100%
89.29% (-10.71% 🔻)
🟢
... / index.ts
94.44% (-1.01% 🔻)
75% (+8.33% 🔼)
100% 100%
🟡
... / index.tsx
72.73% (-10.61% 🔻)
0% 0%
70% (-10% 🔻)
🟡
... / index.tsx
59.86% (-6.21% 🔻)
43.75% (-1.25% 🔻)
55.56% (-5.98% 🔻)
60.58% (-5.45% 🔻)
🟡 src/pages/_app.tsx
69.33% (-0.53% 🔻)
42.86% 0%
68.06% (-0.52% 🔻)
🔴
... / index.tsx
30.08% (-6.46% 🔻)
0% 0%
33.04% (-8.27% 🔻)
🔴
... / index.tsx
55% (-5% 🔻)
0% 0%
57.89% (-6.39% 🔻)
🟡
... / index.tsx
62.5% (-1.14% 🔻)
0% 0%
65.22% (-1.45% 🔻)
🔴
... / index.tsx
39.29% (-0.71% 🔻)
0% 0%
40% (-0.82% 🔻)
🟡
... / index.tsx
51.22% (-12.42% 🔻)
0% 0%
60% (-15% 🔻)
🔴
... / PaginatedSafeList.tsx
35.29% (-7.56% 🔻)
0% 0%
41.38% (-3.07% 🔻)
🔴
... / index.tsx
52.17% (+2.17% 🔼)
16.67% (-5.56% 🔻)
10%
55.81% (+2.16% 🔼)
🔴
... / useTrackedSafesCount.ts
34.62% (-3.48% 🔻)
0% 0%
36% (-4% 🔻)
🔴
... / CounterfactualSuccessScreen.tsx
25% (-7.14% 🔻)
0% 0%
28.21% (-6.41% 🔻)

Test suite run success

1570 tests passing in 207 suites.

Report generated by 🧪jest coverage report action from 295fef7

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@schmanu schmanu changed the title Epic: Multichain Safes with same address [Multichain] Epic: Multichain Safes with same address Sep 9, 2024
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

schmanu and others added 3 commits September 12, 2024 16:29
* feat: SetupToL2 during Safe creation

* feat: use setupToL2 when relaying safe creation

* Feat: add network selector to safe setup

* feat: deploy CF safes on selected networks

* feat: require at least on network to be selected

* fix: creation overview network styles

* Fix: only show wrong chain warning when relevant

* fix: unit tests for ReviewStep and relay creation

* fix: load safe cypress tests

* remove unecessary check in safe creation

* feat: simplify mnemonic safe name

* fix: network multiselector chip styles

* fix: update safe name unit test

* refactor: change multiselector to uncontrolled component with RHF

* fix: remove references to pay later option when it is not available

* feat: exclude xksync from multichain and only offer chains of the same version

* fix: dont allow older safes to be deployed as multichain group

* only allow selecting a single network in the advanced safe creation flow

* fix: check across chains for the next available saltNonce

* fix: wrong chain warning on activation flow

* allow CF deployment for m/n safes

* feat: show success modal on multichain safe creation

* fix: only allow networks with canonical 1.4.1 deployments to be multichain safes

* fix: dismiss CF creation modal in cypress tests

* feat: modify fee info text for multi chain safe creation

* fix: remove unecessary promise.all and account for undefined numberOfOwners in setup hints

* fix: remove unused code and use router.replace for network multi selector

* refactor: move setup contract address to constants.ts

* fix: check chains are compatible with first selected network and wrap multiselector functions in useCallbacl

* fix: remove commented code

---------

Co-authored-by: James Mealy <[email protected]>
…chain safe [SW-150] (#4151)

* feat: add warning when adding or removing an owner to multichain safes

* fix: change owner to signer in text and fix typos

* feat: use current chain name in warning message
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

usame-algan and others added 2 commits September 16, 2024 10:22
…-171] (#4163)

* fix: Hide header network selector on non-safe routes

* fix: Failing import export data e2e test

* fix: Move MenuItem component back to be a function and fix e2e test

* fix: Revert NetworkInput refactor

* fix: Failing load_safe e2e test
Copy link

github-actions bot commented Sep 16, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

schmanu and others added 3 commits September 17, 2024 15:49
…tiaccounts (#4125)

- Redesigns how sub-items are displayed under multi-accounts.
- Adds context menu for multi accounts offering renaming and adding a new network
- Some UX fixes around the context menu
Copy link

github-actions bot commented Sep 17, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

usame-algan and others added 4 commits September 17, 2024 18:29
…4180)

* fix: Network selector links and visual style

* fix: Update dependency arrays
* fix: Show zksync network but disabled

* fix: Show message if zksync safe is open

* fix: Adjust tests for useReplayableNetworks
@schmanu schmanu marked this pull request as ready for review October 10, 2024 10:32
usame-algan and others added 2 commits October 10, 2024 16:11
…-270] (#4355)

* fix: Copy owners to address book when replaying safe

* Update src/features/multichain/components/CreateSafeOnNewChain/index.tsx

Co-authored-by: Manuel Gellfart <[email protected]>

---------

Co-authored-by: Manuel Gellfart <[email protected]>
async (factoryAddress, provider) => `${factoryAddress}${(await provider.getNetwork()).chainId}`,
)

export const predictAddressBasedOnReplayData = async (safeCreationData: ReplayedSafeProps, provider: Provider) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense for this util method to be under src/components/welcome when you are also using it in serc/components/new-safe ? Maybe it should be moved to a different utils location?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will move it to features/multichain/utils

networks: Pick<ChainInfo, 'chainId'>[]
showHasMore?: boolean
}) => {
const MAX_NUM_VISIBLE_CHAINS = 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could be moved outside of the function

Copy link
Collaborator

@compojoom compojoom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schmanu schmanu merged commit 4839c66 into dev Oct 14, 2024
15 checks passed
@schmanu schmanu deleted the epic/multichain-safes branch October 14, 2024 15:23
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants