Submitted by CertoraInc, also found by cccz, csanuragjain, jonatascm, and scaraven
https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L418
Some ERC20 tokens implemented so a fee is taken when transferring them, for example STA and PAXG. The current implementation of the VotingEscrow contract will mess up the accounting of the locked amounts if token will be a token like that, what will lead to a state where users wont be able to receive their funds.
This will happen because the value that is added to the locked amount is not the actual value received by the contract, but the value supplied by the user (the value which the fee is taken from).
The STA token burns 1% of the value provided to the transfer function, which means the recipient gets only 99% of the transferred asset. Lets assume that token is the address of the STA token.
Manual auditing - VS Code and me :)
Calculate the amount to add to the locked amount by the difference between the balances before and after the transfer instead of using the supplied value.
lacoop6tu (FIAT DAO) disputed and commented:
Justin Goro (judge) commented:
elnilz (FIAT DAO) commented:
Justin Goro (judge) commented:
IllIllI (warden) reviewed mitigation:
