code-423n4 / 2023-09-asymmetry-findings

2 stars 1 forks source link

It might not be possible to `applyRewards()`, if an amount received is less than 0.05 eth #16

Open c4-submissions opened 10 months ago

c4-submissions commented 10 months ago

Lines of code

https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/strategies/votium/VotiumStrategyCore.sol#L302-L304

Vulnerability details

Vulnerability Details

Impact

Recommended Mitigation Steps

Assessed type

Context

elmutt commented 10 months ago

Nice find. At first glance it doesnt seem to matter but when you pointed out out early market conditions resulting in less rewards it makes total sense that it will be a problem we will likely encounter

Rassska commented 9 months ago

Ooppss, the reward threshold defined here should be changed to:

$$ \frac{0,000016} {ratio} * \sum_{i = 0}^{lockedBalances.length - 1} lockedBalances[i] $$

Meaning that:

elmutt commented 9 months ago

Thanks! After discussing internally we decided to solve this by calling setMinAmount(0) on the safEth contract.

Will update this issue when thats done

c4-judge commented 9 months ago

0xleastwood marked the issue as primary issue

c4-judge commented 9 months ago

0xleastwood marked the issue as selected for report

c4-sponsor commented 9 months ago

elmutt (sponsor) confirmed

elmutt commented 9 months ago

this is done: https://etherscan.io/tx/0xb024f513adb9a8fa3bbceceeb6c11d2a1bc9c5e3545dfa76f6d6e0c8bdaf38a3