Submitted by Aymen0909, also found by 0xf15ers, 0xSky, auditor0517, bin2chen, CertoraInc, csanuragjain, JohnSmith, scaraven, tabish, wagmi, and yixxas
The potentiel impact of this error are :
The error occured in this line :
https://github.com/code-423n4/2022-08-fiatdao/blob/main/contracts/VotingEscrow.sol#L513
In the increaseUnlockTime function the oldLocked.end passed to the function _checkpoint is wrong as it is the same as the new newLock end time (called unlock_time) instead of being equal to oldUnlockTime .
In the given CheckpointMath.md file it is stated that checkpoint details for  increaseUnlockTime function should be :
BUT with this error  you get a different checkpoint details :
The error is illustrated in the code below :
The impact of this is when calculating the userOldPoint.bias in the _checkpoint function you get an incorrect value equal to userNewPoint.bias (because oldLocked.end == _newLocked.end which is wrong).
The wrong userOldPoint.bias value is later used to calculate and update the bias value for the new point in PointHistory.
And added to that the wrong oldLocked.end is used to get oldSlopeDelta value which is used to update the slopeChanges.
As the PointHistory and the slopeChanges values are used inside the functions balanceOfAt() ,  _supplyAt(),  totalSupply(),  totalSupplyAt() to calculate the voting power, this error could give wrong voting power at a given block of a user or can give wrong total voting power.
The line 513 in the VotingEscrow.sol contract :
Need to be replaced with the following :
lacoop6tu (FIAT DAO) confirmed, but disagreed with severity and commented:
Justin Goro (judge) decreased severity to Medium and commented:
IllIllI (warden) reviewed mitigation:
