Badger-Vested-Aura contest - saian's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 15/06/2022

Pot Size: $30,000 USDC

Total HM: 5

Participants: 55

Period: 3 days

Judge: Jack the Pug

Id: 138

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 37/55

Findings: 1

Award: $53.62

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

53.6173 USDC - $53.62

Labels

bug
QA (Quality Assurance)
sponsor disputed
valid

External Links

Non-critical findings

Replace assert with require statement

In initialize function assert statement is used to validate vault token, Assert should be used to check for internal errors and invariants and require should be used to validate external input data

Proof of concept
assert(IVault(_vault).token() == address(AURA));

Open TODOs

The contract has open todos which can be fixed and removed

Proof of concept

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L284

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L422

Missing or incomplete natspec comments

Functions are missing param comments

Proof of concept

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L79

/// @dev Change Delegation to another address function manualSetDelegate(address delegate) external {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L86

///@dev Should we check if the amount requested is more than what we can return on withdrawal? function setWithdrawalSafetyCheck(bool newWithdrawalSafetyCheck) external {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L92

///@dev Should we processExpiredLocks during reinvest? function setProcessLocksOnReinvest(bool newProcessLocksOnReinvest) external {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L98

///@dev Change the contract that handles bribes function setBribesProcessor(IBribesProcessor newBribesProcessor) external {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L107

/// @notice Will not notify the BRIBES_PROCESSOR as this could be triggered outside bribes function sweepRewardToken(address token) public nonReentrant {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L116

/// @dev Bulk function for sweepRewardToken function sweepRewards(address[] calldata tokens) external {

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

/// @dev allows claiming of multiple bribes, badger is sent to tree /// @notice Hidden hand only allows to claim all tokens at once, not individually. /// Allows claiming any token as it uses the difference in balance function claimBribesFromHiddenHand(IRewardDistributor hiddenHandDistributor, IRewardDistributor.Claim[] calldata _claims) external nonReentrant {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L385

function checkUpkeep(bytes calldata checkData) external view returns (bool upkeepNeeded, bytes memory performData) {

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L391

/// @dev Function for ChainLink Keepers to automatically process expired locks function performUpkeep(bytes calldata performData) external {

#0 - GalloDaSballo

2022-06-19T17:59:27Z

Disagree with natspec, the best comment is the one you don't write.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter