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

frontend: Integrate Safe #1755

Merged
merged 14 commits into from
May 8, 2023
Merged

frontend: Integrate Safe #1755

merged 14 commits into from
May 8, 2023

Conversation

manuelwedler
Copy link
Contributor

@manuelwedler manuelwedler commented Apr 27, 2023

see #1507
(we still need to open an issue against their repo to get listed in the Safe App)

This was much more work than expected. Some function declarations and interfaces of our internal architecture needed to get changed. A few things are still missing: The warning if the target address is the same as the Safe's one is missing. Some tests are missing. Maybe it would be nicer to use a flag on the IEthereumProvider interface if the disconnect should be shown or if the target address should be prefilled.

@manuelwedler
Copy link
Contributor Author

Added a commit for showing the warning if the same address as the connected Safe is chosen for the target address.

Copy link
Contributor

@GabrielBuragev GabrielBuragev left a comment

Choose a reason for hiding this comment

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

Nice! Some amazing improvements in the structure of the providers and i can already see its paying off. Great job man.

I have a decent amount of nitpicky suggestions and some questions. Once they are addressed happily approving!

frontend/src/components/RequestSourceInputs.vue Outdated Show resolved Hide resolved
frontend/src/actions/transfers/transfer.ts Show resolved Hide resolved
frontend/src/services/web3-provider/safe-provider.ts Outdated Show resolved Hide resolved
frontend/tests/utils/mocks/ethereum-provider.ts Outdated Show resolved Hide resolved
frontend/src/components/RequestTargetInputs.vue Outdated Show resolved Hide resolved
@GabrielBuragev GabrielBuragev self-requested a review May 8, 2023 14:58
Copy link
Contributor

@GabrielBuragev GabrielBuragev left a comment

Choose a reason for hiding this comment

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

Looks perfect, great job! Thanks for addressing all the comments.

Moves any functionality but token adding and switching chains into a new abstract class `BasicEthereumProvider`. Enables to have providers which don't support these functionalities.
…er` optional

Not all providers necessarily support these, like for example the Safe provider.
Copy link
Contributor

@GabrielBuragev GabrielBuragev left a comment

Choose a reason for hiding this comment

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

Perfect! ✅

… switching chains

In this case only the connected chain should be shown.
…so available

There were some issues with the Safe integration. A safe could for example have setup multiple required signatures. Before a tx could fail when continued because the provider was not available. With multisignature safes it must be possible to close the app come back later.
Enables to connect to a gnosis Safe. It adds new autoconnect function for connecting as it is required by Safe.
Enables to use provider specific functionalities in these functions. Also makes the coupling with ethers JsonRPCSigner less. In the future we should instead use our own Signer interface to distinguish between simple providers for read operations and wallets which are able to sign tx.
Safe's use a special internal safeTxHash which is returned from the provider. We cannot use it to get the transaction events or show it in the explorer.
We assumed that our event is always the first one. In cases such as when using a safe provider the transaction call is delegated, therefore other events of the SafeProxy are also included in the transaction.
Safes are only autoconnected and they could not get connected again.
The issue is that a Safe is a contract which only exists on one chain.
…nectable and being a contract wallet

Makes these features reusable when we introduce other providers
@manuelwedler manuelwedler force-pushed the frontend/safe-integration branch from 7bad9ca to 2207b1e Compare May 8, 2023 15:44
@manuelwedler manuelwedler merged commit 17a0670 into main May 8, 2023
@manuelwedler manuelwedler deleted the frontend/safe-integration branch May 8, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants