code-423n4 / 2022-06-badger-findings

0 stars 0 forks source link

QA Report #51

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

1. Missing zero address checks

Risk

Low

Impact

Missing checks for zero addresses might lead to loss of funds, failed transactions and can break the protocol functionality.

Proof of Concept

MyStrategy.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add zero address checks for listed parameters.

2. Missing events

Risk

Low

Impact

Contract is missing emitting events for critical functions. Lack of events makes it difficult for off-chain applications to monitor the protocol.

Proof of Concept

MyStrategy.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add missing events to listed functions.

3. Missing indexing for events

Risk

Non-Critical

Impact

Events should index addresses which helps off-chain applications in monitoring the protocol.

Proof of Concept

MyStrategy.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add indexing to address type parameters.

4. Deprecated safeApprove

Risk

Non-Critical

Impact

Function safeApprove has been deprecated in favor of safeIncreaseAllowance() and safeDecreaseAllowance().

Proof of Concept

MyStrategy.sol:65:        AURA.safeApprove(address(LOCKER), type(uint256).max);
MyStrategy.sol:67:        AURABAL.safeApprove(address(BALANCER_VAULT), type(uint256).max);
MyStrategy.sol:68:        WETH.safeApprove(address(BALANCER_VAULT), type(uint256).max);

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to consider using safeIncreaseAllowance() and safeDecreaseAllowance() functions instead of safeApprove.

5. Missing natspec comments

Risk

Non-Critical

Impact

Contract is missing natspec comments which makes code more difficult to read and prone to errors.

Proof of Concept

MyStrategy.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add missing natspec comments.

GalloDaSballo commented 2 years ago

Dup of #52