Skip to content

Conversation

@77ph
Copy link
Collaborator

@77ph 77ph commented Jul 14, 2025

  • Internal audit

@77ph 77ph requested a review from 8ball030 July 14, 2025 09:06
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.
```
Copy link
Contributor

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()
```
Copy link
Contributor

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);
Copy link
Contributor

@8ball030 8ball030 Jul 14, 2025

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?

Copy link
Collaborator Author

@77ph 77ph Jul 15, 2025

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

#38

Resolves

Also catches 2 more issues;

i) check promised prior to doning

ii) reentrency check;

#38

Copy link
Collaborator Author

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];
Copy link
Contributor

Choose a reason for hiding this comment

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

fixed in;
#39

@8ball030 8ball030 merged commit 5e01783 into main Jul 18, 2025
1 check passed
@8ball030 8ball030 deleted the audit1 branch July 18, 2025 16:07
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

Successfully merging this pull request may close these issues.

4 participants