-
Notifications
You must be signed in to change notification settings - Fork 0
doc: audit #35
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
doc: audit #35
Conversation
77ph
commented
Jul 14, 2025
- Internal audit
| Sending native tokens to a contract changes the balance, but does not change the variables. | ||
| Not checked msg.value vs roundPoints[curRound].minDonation | ||
| I recommend removing the function if it has no other use or limiting it to the owner only. | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#37
Removed in
| ### Low: No emit | ||
| ``` | ||
| No emit in withdrawIncentiveTokenBalance() | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7f64736
| Before using other tokens, check their behavior on call approve(0). | ||
| Ref: | ||
| ``` | ||
| IToken(incentiveTokenAddress).approve(permit2, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a problem?
Or can the current implementation be left as id like to basically add a new function to swap out the incentivised pool
Will this break other tokens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Just notes.
Perhaps such tokens exist where it is not allowed to do approve(0) - but I don't know any like that.
| ### Medium: withdrawIncentiveTokenBalance() | ||
| You can't take away by owner what has already been promised for rewards and donations have already been made in round - 1. | ||
| ``` | ||
| uint256 claimRound = currentRound - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
| Confusing calculations. Actually the point is that if `roundToClaimed[claimRound][account] > 0` then you need to return 0. | ||
| ``` | ||
| uint256 amount = (donation * roundPoints[claimRound].availableRewards) / totalRoundDonations; | ||
| uint256 claimedAmount = roundToClaimed[claimRound][account]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in;
#39