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

0 stars 0 forks source link

QA Report #82

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

[QA-1] Avoid using assert

According to the solidity doc, using assert should be avoided.

The assert function should only be used to test for internal errors, and to check invariants. Properly functioning code should never reach a failing assert statement; if this happens there is a bug in your contract which you should fix.

initialize function uses assert so it is worth revisiting.

https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L57


[QA-2] Naming inconsistency - some arguments have _ at their prefixes but others do not

Throughout the codebase, arguments of functions do not have _ at their prefixes like function checkUpkeep(bytes calldata checkData). However, following 3 arguments have _ at their prefixes which are not consistent.

https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L171

https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L194

https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L288