Submitted by CertoraInc, also found by 0x1f8b, carlitox477, cRat1st0s, DecorativePineapple, joestakey, ladboy233, reassor, and rvierdiiev
https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L418
The unsafe casting to int128 variable can cause its value to be different from the correct value. For example in the createLock function, the addition to the locked amount variable is done by locked_.amount += int128(int256(_value)). In that case, if _value is greater than type(int128).max which is 2**127 - 1, then the accounting will be wrong and the amount that will be added to locked_.amount will be less than the amount of token that will be transferred from the user. Then the user wont be able to withdraw the tokens that he transferred, and theyll be stuck in the contract forever.
Manual auditing - VS Code and me :)
Make sure that the values fit in the variables you are trying to assign them to when casting variables to smaller types.
lacoop6tu (FIAT DAO) acknowledged and commented:
Justin Goro (judge) decreased severity and commented:
IllIllI (warden) reviewed mitigation:
