Platform: Code4rena
Start Date: 08/07/2021
Pot Size: $50,000 USDC
Total HM: 7
Participants: 13
Period: 7 days
Judge: ghoulsol
Total Solo HM: 5
Id: 18
League: ETH
Rank: 6/13
Findings: 3
Award: $1,470.21
🌟 Selected for report: 2
🚀 Solo Findings: 0
JMukesh
It is usually good to add a require-statement that checks the return value or to use something like safeTransfer; unless one is sure the given token reverts in case of a failure.
manual review
check the return value return from transfer()
#0 - talegift
2021-07-15T06:40:30Z
Not clear which code is this referring to. Possible duplicate of #67
🌟 Selected for report: JMukesh
916.341 USDC - $916.34
JMukesh
Due to the implementation of the approve() function in LPTokenMaster.sol it's possible for a user to over spend their allowance in certain situations.
https://www.adrianhetman.com/unboxing-erc20-approve-issues/
manual review
Instead of having a direct setter for allowances, decreaseAllowance and increaseAllowance functions should be exposed which decreases and increases allowances for a recipient respectively.
#0 - talegift
2021-07-15T06:13:16Z
This is not possible. Solidity 8 checks for underflow.
#1 - ghoul-sol
2021-08-01T21:56:02Z
Warden, please provide more explicit explanation of the exploit in the future so we don't have to guess. Providing an article link is not the way to do it. Making this a low risk as this is a well known issue and the protocol doesn't really depend on it.
JMukesh
Due to incorrect position of require condition,
require(_amount > 0, "TransferHelper: amount must be > 0");
This condition should be at the initial point of function not at the end of function because 0 amount can be entered to transfer token
bool success = IERC20(_token).transferFrom(_sender, address(this), _amount);
manual review
add require() at starting point
#0 - talegift
2021-07-15T06:08:20Z
#56
🌟 Selected for report: JMukesh
152.0774 USDC - $152.08
JMukesh
if we declare - address public feeRecipient; with bool public depositsEnabled and bool public depositsEnabled;
these variable can be packed in single slot , because they occupy total 22bytes of 32byte memory sloth
ex - address public feeRecipient bool public depositsEnabled bool public depositsEnabled
manual review