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

N-02 Sender Is Unable to Decrease the Thaw Amount or Cancel the Thaw #41

Closed
ColePBryan opened this issue Aug 17, 2023 · 3 comments · Fixed by #52
Closed

N-02 Sender Is Unable to Decrease the Thaw Amount or Cancel the Thaw #41

ColePBryan opened this issue Aug 17, 2023 · 3 comments · Fixed by #52
Assignees
Labels

Comments

@ColePBryan
Copy link
Contributor

The thaw function in Escrow.sol can only increase the value to be withdrawn from an EscrowAccount . Additionally, the only way to reset the amountThawing for an EscrowAccount to zero is to call withdraw , which will pull the requested GRT from the account. Therefore, there is no way to cancel a thaw action. This can lead to a poor user experience for depositors and accounts.

Consider creating an additional function, cancelThaw , that reduces the amountThawing value for an account to zero.

@ColePBryan ColePBryan self-assigned this Aug 17, 2023
@ColePBryan
Copy link
Contributor Author

@aasseman @tmigone I added changes to allow cancelling thawing. One feature I'm not sure if we need/want is partial cancelling. If we do want that I need to also know what we should do with thaw counter when that happens. When we increase amount thawing we restart the counter. I'm assuming in this case we would just leave it untouched since it wouldn't negatively impact the receiver.

@aasseman
Copy link
Collaborator

All of this could be a single function where you can only set the amount thawing (replaces instead increasing the amount), then handle the cases where the amount requested is 0 (cancel), < prev_thawing_amount (decrease) , > prev_thawing_amount (increase).

@ColePBryan
Copy link
Contributor Author

That's a very good point. That logic is essentially already there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants