Therefore,Airdrop itself gets userRewards when it sends tokens to users,
The problem is that these tokens cannot be used and will remain in Airdrop contract forever.
Tools Used
vscode, manual
Recommended Mitigation Steps
Do not send userRewards to the Airdrop contract at _decreaseUserShare
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/Staking.sol#L130
Vulnerability details
Impact
The salt token is locked into the airdrop contract
Proof of Concept
Airdrop
will usetransferStakedSaltFromAirdropToUser
function will be salt token (Staked) sent to the user:_decreaseUserShare
sendsuserRewards
to the owner:Therefore,
Airdrop
itself getsuserRewards
when it sends tokens to users, The problem is that these tokens cannot be used and will remain in Airdrop contract forever.Tools Used
vscode, manual
Recommended Mitigation Steps
Do not send
userRewards
to the Airdrop contract at_decreaseUserShare
Assessed type
Error