20,000 USDC
View results
Submission Details
Severity: low
Valid

Low Risk Report

[L-01] address(0) check missing in functions

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/utils/Ownable.sol#L14-L17

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L100-L102

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L31-L34

Recommendation

Add a check if != address(0)

[L-02] safeTransfer and safeTransferFrom methods should be used for token transfers

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L39

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L49

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L55

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Fees.sol#L43

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L152

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L159

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L187

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L203

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L267-L271

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L317-L329

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L403

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L505

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L563-L565

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L642-L670

Recommendation

User safeTransfer and safeTransferFrom instead of safeERC20 library

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol

[L-03] Validation checks missing

Add a check of amount != 0 and _profits != address(0)
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Fees.sol#L28

Add a check of _amount != 0
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L38

Add a check that _amount != 0 and _amount <= balances[msg.sender]
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L46

Add a check that _weth != address(0) and _staking != address(0)
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Fees.sol#L19-L22

Add a check that claimable[msg.sender] <= WETH.balanceOf(address(this)
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Staking.sol#L55

Add a check that amount <= pools[poolId].poolBalance in the begining
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L198

[L-04] Length of arrays validation missing

The length of arrays should be matched before the iteration to avoid unexpected behaviour

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L359

Recommendation

The size of loanIds and poolIds should be equal before iterating over them.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!