Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #59

Open
code423n4 opened this issue May 1, 2022 · 1 comment
Open

QA Report #59

code423n4 opened this issue May 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Low

Rounding-error can be redeemed for free

If the _redeemAmount is > 0 but less than the value of 1 share, 0 share will be burned while the user can withdraw non-zero amount.
https://github.com/pooltogether/aave-v3-yield-source/blob/e63d1b0e396a5bce89f093630c282ca1c6627e44/contracts/AaveV3YieldSource.sol#L255

    uint256 _shares = _tokenToShares(_redeemAmount);

IERC20 is re-used

        - IERC20 (node_modules/@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol#7-80)
        - IERC20 (node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#9-82)

Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#name-reused

Non-Critical

Upgrade Solidity Version

Consider to pin Solidity version to latest 0.8.12

Use custom errors

Solidity ^0.8.4 allow the use of custom errors to optimize gas usage.
https://blog.soliditylang.org/2021/04/21/custom-errors/

Duplicated code

L337 can reuse _requireNotAToken in L348
https://github.com/pooltogether/aave-v3-yield-source/blob/e63d1b0e396a5bce89f093630c282ca1c6627e44/contracts/AaveV3YieldSource.sol#L337
https://github.com/pooltogether/aave-v3-yield-source/blob/e63d1b0e396a5bce89f093630c282ca1c6627e44/contracts/AaveV3YieldSource.sol#L348

Remove safeMath library

Solidity > 0.8.0 have safe math by default
https://github.com/pooltogether/aave-v3-yield-source/blob/e63d1b0e396a5bce89f093630c282ca1c6627e44/contracts/AaveV3YieldSource.sol#L26

  using SafeMath for uint256;
@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 1, 2022
code423n4 added a commit that referenced this issue May 1, 2022
@PierrickGT PierrickGT self-assigned this May 3, 2022
@PierrickGT
Copy link
Member

Rounding-error can be redeemed for free

Duplicate of #44

IERC20 is re-used

We prefer to use the one coming from the OpenZeppelin package.

Upgrade Solidity Version

Not possible since Aave V3 uses 0.8.10

Use custom errors

Duplicate of #13

Duplicated code

Duplicate of #4

Remove safeMath library

Duplicate of #11

@PierrickGT PierrickGT added the duplicate This issue or pull request already exists label May 3, 2022
@JeeberC4 JeeberC4 removed the duplicate This issue or pull request already exists label May 6, 2022
@JeeberC4 JeeberC4 reopened this May 6, 2022
@gititGoro gititGoro added 3 (High Risk) Assets can be stolen/lost/compromised directly duplicate This issue or pull request already exists and removed QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 17, 2022
@gititGoro gititGoro marked this as a duplicate of #44 May 17, 2022
@gititGoro gititGoro marked this as not a duplicate of #44 May 22, 2022
@gititGoro gititGoro added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed duplicate This issue or pull request already exists 3 (High Risk) Assets can be stolen/lost/compromised directly labels May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

4 participants