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

Shorten name of WithdrawAmountGreaterThanWithdrawableAmount error #458

Closed
PaulRBerg opened this issue Apr 25, 2023 · 1 comment
Closed
Assignees

Comments

@PaulRBerg
Copy link
Member

As @IaroslavMazur pointed out in his audit report conducted in March 2023, the name of this custom error is long:

https://github.com/sablierhq/v2-core/blob/2b71d0762706ad04cdad58e37d2c6db0b6274496/src/libraries/Errors.sol#L82-L84

He suggested renaming the error to AmountTooBig, but I did not like this wording because it can easily be confused with something else, e.g. an overflow, so I ended up brushing the issue aside.

In the meantime, I have stumbled upon the term "overdraw", which is perfect given the context of the withdraw function; let me show you the definition from Cambridge Dictionary:

to take more money out of your bank account than the account contains

Therefore, we should rename the error like this:

error SablierV2Lockup_Overdraw
@IaroslavMazur
Copy link
Member

Indeed, "overdraw" looks like the perfect fit for the "trying to withdraw too much" scenario.

Great finding, @PaulRBerg!

PaulRBerg added a commit that referenced this issue Apr 27, 2023
Rename `WithdrawAmountGreaterThanWithdrawableAmount` to `Overdraw`

Close #458
PaulRBerg added a commit that referenced this issue May 1, 2023
Rename `WithdrawAmountGreaterThanWithdrawableAmount` to `Overdraw`

Close #458
PaulRBerg added a commit that referenced this issue May 1, 2023
Rename `WithdrawAmountGreaterThanWithdrawableAmount` to `Overdraw`

Close #458
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

No branches or pull requests

2 participants