https://github.com/kinetic-market/public-money-market-contracts
In the CTokenRewards
contract, the depositEther
function includes the following check:
require(totalAmount == msg.value, "insufficient amount");
This ensures that the deposited Ether is equal to the total reward amount. However, in the depositTokens
function, the check is as follows:
require(actualTransferredAmount >= totalAmount, "Invalid deposit");
This condition could potentially allow for more tokens to be deposited than the total reward amount. As a result, it may cause an excessive deposit of tokens beyond the intended reward. Moreover, since the contract does not have a function to withdraw the excess tokens, this could result in wasted tokens for the owner.
To prevent this issue, the contract should ensure that deposits are strictly limited to the total reward amount.
https://github.com/kinetic-market/public-money-market-contracts/blob/d46f5223344ff6502349549ad858588e496483df/contracts/Tokenomics/rewards/CTokenRewards.sol#L73