-
Notifications
You must be signed in to change notification settings - Fork 478
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: Execute transaction through role #3768
Conversation
Branch preview✅ Deploy successful! Storybook: |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
950.36 KB (🟡 +295 B) |
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!
Six Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/apps/open |
50.93 KB (🟡 +33 B) |
1001.29 KB |
/transactions |
73.93 KB (🟡 +33 B) |
1 MB |
/transactions/history |
73.89 KB (🟡 +33 B) |
1 MB |
/transactions/messages |
34.77 KB (🟡 +33 B) |
985.13 KB |
/transactions/queue |
29.17 KB (🟡 +33 B) |
979.53 KB |
/transactions/tx |
18.92 KB (🟡 +33 B) |
969.28 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.
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1441 tests passing in 198 suites. Report generated by 🧪jest coverage report action from 822271d |
d6bda87
to
962520a
Compare
Hey @jfschwarz, great addition! A few suggestions to improve the texts: Execute without confirmations |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
8592dc1
to
fd6d915
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jfschwarz! Excellent work!
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2024 Safe Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
What it solves
With SEP-14 the community voted to implement role-based access control in Safe{Wallet} based on the Zodiac Roles Modifier.
How this PR fixes it
This PR allows role members to use Safe{Wallet} to execute transaction from the Safe using their role. For this purpose, a new section has been added to the transaction sign/execute form, which only shows up if the connected wallet is a member of any role enabled on the Safe.
How to test it
assignRoles
functionAlternatively, send me your EOA address so I can assign a role in my Sepolia test setup to it.
Screenshots
A new card appears in the transaction sign/execute form only if the Safe has a Roles mod enabled and the connected wallet account is a role member.
Connected with role member wallet, permission checks pass:
Connected with role member wallet, permission checks fail:
(Status can be any value from the Roles mods' Status enum)
Checklist
Implementation details
In any of the following cases, nothing will be rendered and no extra network requests will be made:
Otherwise we perform a fetch request against the official role subgraph for each enabled module, checking if the module is a Roles v2 mod and retrieving its role configuration (permissions and members).
We only render the new card, if the connected wallet has any roles assigned. (There can be multiple Roles mods enabled on the Safe. An address can have multiple roles assigned on each mod.)
Next step is checking if the current transaction is allowed for any role assigned to the connected wallet address:
If any assigned role allows the call, we enable the "Execute" button. Otherwise we show the failing permission check status for the role most likely to be meant for the given transaction, "most likely" being defined by the following order: