code-423n4 / 2024-01-salty-findings

4 stars 3 forks source link

Division Leading to Loss of Precision #972

Closed c4-bot-6 closed 5 months ago

c4-bot-6 commented 5 months ago

Lines of code

https://github.com/code-423n4/2024-01-salty/blob/main/src/launch/Airdrop.sol#L64

Vulnerability details

Impact

Detailed description of the impact of this finding. Division Leading to Loss of Precision: When calculating saltAmountForEachUser, any remainder from the division is not accounted for. This could lead to a loss of precision and potentially leave some SALT tokens undistributed.

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.

uint256 saltBalance = salt.balanceOf(address(this));
@>  saltAmountForEachUser = saltBalance / numberAuthorized();

    // Have the Airdrop approve max so that that xSALT (staked SALT) can later be transferred to airdrop recipients.
    salt.approve( address(staking), saltBalance );

Tools Used

VS Code

Recommended Mitigation Steps

currently, I cannot find the exact location where to send the remaining salt.

Assessed type

Other

c4-judge commented 5 months ago

Picodes marked the issue as unsatisfactory: Insufficient proof