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

fix(twap): display a warning when fbh was changed after twap order #5202

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

shoom3301
Copy link
Collaborator

@shoom3301 shoom3301 commented Dec 13, 2024

Summary

Since fb handler might be changed in a random moment, we should handle the case.
We recently added the fb handler verification cache invalidation - #5200.
In this PR I added a banner which is displayed when fb handler is not installed and there are open TWAP orders.

I know, the banner is ugly, @fairlighteth please help 🙏

image image

To Test

  1. Create a TWAP order (along with it you should have set thw fallback handler)
  2. Reset the fallback handler
  3. Update page (might take up to 10 mins due to cache)
  • The banner should be displayed
  • Click to "Update fallback handler" should create a transaction with fbh setup
  • After tx creation the banner should transit to loading state
  • After tx mining the banner should dissapear

If you need to reset a fn handler, just create a transaction via transaction builder:

  • target: your safe address
  • raw data: 0xf08a032300000000000000000000000075cf11467937ce3f2f357ce24ffc3dbf8fd5c226

And don't forget to remove fallbackHandlerVerification localStorage key after that

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am
cowfi ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am
explorer-dev ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am
sdk-tools ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am
swap-dev ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am
widget-configurator ✅ Ready (Inspect) Visit Preview Dec 17, 2024 11:09am

Copy link

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

LGTM in terms of functionality. Waiting for UI changes :)

* feat: style TWAP warning banner

* feat: fix typo and change orientation of banner
@shoom3301
Copy link
Collaborator Author

Merged #5204 PR from @fairlighteth with design changes in this PR

@shoom3301 shoom3301 added the RELEASE Included in the release that is being closed label Dec 17, 2024
Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

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

Soft approve. Really great addition. Thanks a lot for handling this 🙏

const txHash = await setupFallbackHandler()

if (txHash) {
setPendingTxHash(txHash)
Copy link
Contributor

Choose a reason for hiding this comment

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

A re-render of this would loose the posted TX, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch!
Fixed it: 35f1802
Thanks!

@elena-zh
Copy link

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
RELEASE Included in the release that is being closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants