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

PoolBase.sol: Consider returning 0 instead of reverting in LockToToken() #42

Open
code423n4 opened this issue Jul 26, 2021 · 0 comments
Labels
0 (Non-critical) bug Something isn't working sponsor acknowledged Sponsor acknowledged, but not resolving

Comments

@code423n4
Copy link
Contributor

Handle

hickuphh3

Vulnerability details

Impact

In the LockToToken() function, should either the stake balance or the lockToken total supply return 0, the function reverts with NO_DATA.

However, in the (hopefully) rare scenario where the entire stake balance is used for a payout, the function should return 0 instead of reverting.

Recommended Mitigation Steps

Consider returning 0 in the case where balance == 0. Perhaps a zero value can be returned in the case where totalLock is zero as well.

@code423n4 code423n4 added 0 (Non-critical) bug Something isn't working labels Jul 26, 2021
code423n4 added a commit that referenced this issue Jul 26, 2021
@Evert0x Evert0x added the sponsor acknowledged Sponsor acknowledged, but not resolving label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) bug Something isn't working sponsor acknowledged Sponsor acknowledged, but not resolving
Projects
None yet
Development

No branches or pull requests

2 participants