Incompatibility With Rebasing/Deflationary/Inflationary tokens
Summary
The Merit Circle protocol do not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.
Vulnerability Detail
The Merit Circle protocol do not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.
Suppose 100 USDT is transferred via safeTransferFrom() to the TimeLockPool contract.
And a fee is applied (currently 0, but might be changed in the future).
Then you might receive 99.99 USDT
Now you try to do _mint(_receiver, mintAmount); ( 100 USDT ), minting amount will be less than excepted.
Impact
The internal accounting system of the liquidity would be inaccurate or break, affecting the protocol operation.
Determine the transferred amount by subtracting the before & after balance. Have a procedure to don't allow the use of rebasing/inflation/deflation underlying tokens.
defsec
medium
Incompatibility With Rebasing/Deflationary/Inflationary tokens
Summary
The Merit Circle protocol do not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.
Vulnerability Detail
The Merit Circle protocol do not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.
Suppose 100 USDT is transferred via
safeTransferFrom()
to the TimeLockPool contract. And a fee is applied (currently 0, but might be changed in the future). Then you might receive 99.99 USDT Now you try to do_mint(_receiver, mintAmount); ( 100 USDT ),
minting amount will be less than excepted.Impact
The internal accounting system of the liquidity would be inaccurate or break, affecting the protocol operation.
Code Snippet
https://github.com/sherlock-audit/2022-10-merit-circle/blob/main/merit-liquidity-mining/contracts/TimeLockPool.sol#L94
Tool used
Manual Review
Recommendation
Determine the transferred amount by subtracting the before & after balance. Have a procedure to don't allow the use of rebasing/inflation/deflation underlying tokens.