Submitted by hyh
Treasury fee can be zero, while collect modules do attempt to send it in such a case anyway as there is no check in place. Some ERC20 tokens do not allow zero value transfers, reverting such attempts.
This way, a combination of zero treasury fee and such a token set as a collect fee currency will revert any collect operations, rendering collect functionality unavailable
Treasury fee can be set to zero:
ModuleGlobals.sol#L109
Treasury fee transfer attempts are now done uncoditionally in all the collect modules.
Namely, FeeCollectModule, LimitedFeeCollectModule, TimedFeeCollectModule and LimitedTimedFeeCollectModule do not check the treasury fee to be send, treasuryAmount, before transferring:
FeeCollectModule.sol#L176
LimitedFeeCollectModule.sol#L194
TimedFeeCollectModule.sol#L190
LimitedTimedFeeCollectModule.sol#L205
The same happens in the FeeFollowModule:
FeeFollowModule.sol#L90
Some ERC20 tokens revert on zero value transfers:
https://github.com/d-xo/weird-erc20#revert-on-zero-value-transfers
Consider checking the treasury fee amount and do transfer only when it is positive.
Now:
To be:
donosonaumczuk (Aave Lens) confirmed and commented:
Zer0dot (Aave Lens) commented:
Zer0dot (Aave Lens) resolved and commented:
