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

Prevent StreamingPayment uninstallation if pending streams remain #1251

Merged
merged 6 commits into from
Aug 2, 2024

Conversation

area
Copy link
Member

@area area commented May 8, 2024

The main feature here is to prevent uninstallation of the extension in the event that there are some streaming payments unclaimed. It also:

  • Reworks some calculations to prevent over/underflows. This is somewhat opinionated in that the intention is to 'cap' the calculations
  • Allows editing of the interval, which is a requirement. While in an ideal world, editing the interval shouldn't be necessary as you could edit the amount, rounding errors meant that this should be editable as well. This is possible as we have moved to single-stream payments.

@area area force-pushed the maint/single-stream-payments branch from 1a54bad to a17d2b7 Compare May 8, 2024 15:51
@area area force-pushed the feat/no-uninstall-pending-streams branch from f75fde4 to d63d67b Compare May 8, 2024 15:51
@area area force-pushed the maint/single-stream-payments branch from a17d2b7 to 9fddd41 Compare May 29, 2024 10:43
@area area force-pushed the feat/no-uninstall-pending-streams branch 2 times, most recently from 53b7bbf to 58d4d6e Compare May 29, 2024 13:43
@area area force-pushed the maint/single-stream-payments branch from fc1cdaa to a78f8c2 Compare May 30, 2024 07:52
@area area force-pushed the feat/no-uninstall-pending-streams branch from 1929430 to 78ab0ee Compare May 30, 2024 07:53
@area area force-pushed the maint/single-stream-payments branch 2 times, most recently from c0ee585 to 5a5ae87 Compare June 5, 2024 08:35
@area area force-pushed the feat/no-uninstall-pending-streams branch from 78ab0ee to 273ee11 Compare June 5, 2024 08:36
@area area force-pushed the maint/single-stream-payments branch from 5a5ae87 to 89fe76c Compare June 6, 2024 16:22
@area area force-pushed the feat/no-uninstall-pending-streams branch from 273ee11 to 943a097 Compare June 6, 2024 16:23
Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

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

This is a lot of new code just to implement an uninstall check, but so it goes I guess

contracts/extensions/StreamingPayments.sol Show resolved Hide resolved
contracts/extensions/StreamingPayments.sol Outdated Show resolved Hide resolved
@area area force-pushed the feat/no-uninstall-pending-streams branch from 943a097 to d168916 Compare June 10, 2024 09:20
Base automatically changed from maint/single-stream-payments to develop June 10, 2024 13:26
@area area force-pushed the feat/no-uninstall-pending-streams branch 2 times, most recently from 295f2e2 to de82deb Compare June 10, 2024 17:10
Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

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

You mention that changing the interval is necessary to avoid rounding errors, but realistically what are the errors we're talking about? A few wei? I would be in favor of going the opposite direction and hard-coding the interval as 24 hours. We can provide a UI which converts different intervals (hour, week month, etc) if needed.

contracts/extensions/StreamingPayments.sol Outdated Show resolved Hide resolved
contracts/extensions/StreamingPayments.sol Show resolved Hide resolved
@area area force-pushed the feat/no-uninstall-pending-streams branch from de82deb to efb313a Compare July 22, 2024 15:09
@area
Copy link
Member Author

area commented Jul 22, 2024

You mention that changing the interval is necessary to avoid rounding errors, but realistically what are the errors we're talking about? A few wei? I would be in favor of going the opposite direction and hard-coding the interval as 24 hours. We can provide a UI which converts different intervals (hour, week month, etc) if needed.

If tokens don't have, or have set decimals() to 0, then 'A few wei' could easily have significant value.

In terms of a hard-coded interval, even ignore editing existing streams: if we had it at 24 hours, we couldn't e.g. pay out 1 token that had decimals() as 0 every 16 hours.

@area area marked this pull request as ready for review July 22, 2024 16:11
@area area force-pushed the feat/no-uninstall-pending-streams branch from d53bb6c to eac32f2 Compare August 1, 2024 08:02
Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kronosapiens kronosapiens force-pushed the feat/no-uninstall-pending-streams branch from eac32f2 to 08d6b3a Compare August 2, 2024 14:10
@kronosapiens kronosapiens merged commit 8f621c1 into develop Aug 2, 2024
2 checks passed
@kronosapiens kronosapiens deleted the feat/no-uninstall-pending-streams branch August 2, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants