There are ERC20 tokens that may make certain customizations to their ERC20 contracts. One type of these tokens is deflationary tokens that charge a certain fee for every transfer() or transferFrom().
Proof of Concept
A fee on transfer token with a 1 token fee for every 100, that is allowed in the vault.
Alice goes to deposit 100 tokens into the vault
The vault would receive 99 tokens but expected 100 so it would mint 100 tokens of the tigUSD.
Tools Used
Manual Review
Recommended Mitigation Steps
I recommend disallowing fee tokens from being used in the vault. Or It may be better to get the before balance then transferFrom() then get the after balance to make sure no fees were added.
Lines of code
https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/StableVault.sol#L44
Vulnerability details
Impact
There are ERC20 tokens that may make certain customizations to their ERC20 contracts. One type of these tokens is deflationary tokens that charge a certain fee for every
transfer()
ortransferFrom()
.Proof of Concept
tigUSD
.Tools Used
Manual Review
Recommended Mitigation Steps
I recommend disallowing fee tokens from being used in the vault. Or It may be better to get the before balance then
transferFrom()
then get the after balance to make sure no fees were added.