The current implementation doesn't work with fee-on-transfer underlying tokens. e.g. USDT is an ERC20 token that has togglable transfer fees, but for now the fee is set to 0.
The problem arise when transferring tokens back to the last liquidity provider that want to withdraw his tokens blocking redeem function, since the contract wrongly assumes balances values.
There will always be more AssetTokens than its underlying value.
Example with FOT token fee 10%:
Bob deposit 1000 FOT tokens.
AssetTokens contract receives 900 tokens but mint 1000 AssetTokens reedimable for 1000 FOT tokens.
Bob tries to reedem his tokens sending his 1000 AssetTokens but the transfer reverts.
Bob then tries to reedem with 900 AssetTokens and receive 810 FOT tokens.
Alice deposits 1000 FOT tokens.
Bob reedems 90 FOT tokens with his remaining 100 AssetTokens stealing Alice's funds.
Last liquidity providers to withdraw will not be able to redeem their tokens.
Manual review
Add logic to calculate exactly how many tokens were actually sent to the contract.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.