Open code423n4 opened 1 year ago
The mitigation adds a new function, getTotalBalance(), to get all the lp tokens staked in the CVX and others left in the staker:
getTotalBalance()
function getTotalBalance() public view returns(uint256 balance) { unchecked { balance = stakedBalance() + clpToken.balanceOf(address(this)); } }
And every stakedBalance() function call in the AMO2.sol has been replaced by getTotalBalance(). This removes all calculation errors and makes sense.
stakedBalance()
kirk-baird marked the issue as satisfactory
Lines of code
Vulnerability details
The mitigation adds a new function,
getTotalBalance()
, to get all the lp tokens staked in the CVX and others left in the staker:And every
stakedBalance()
function call in the AMO2.sol has been replaced bygetTotalBalance()
. This removes all calculation errors and makes sense.