Skip to content
Business logic Audit finding Beginner

HardVault never deposits assets to Compound

The HardVault contract's deposit and withdraw functions do not move assets to Compound as documented, so deposited assets remain idle and earn no yield. Users expecting interest on their underlying tokens receive none.

obront Follow with koxuan

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-02-blueberry-judging/issues/147

Found by

obront, koxuan

Summary

While the protocol states that all underlying assets are deposited to their Compound fork to earn interest, it appears this action never happens in HardVault.sol.

Vulnerability Detail

The documentation and comments seem to make clear that all assets deposited to HardVault.sol should be deposited to Compound to earn yield:

Solidity
/**
    * @notice Deposit underlying assets on Compound and issue share token
    * @param amount Underlying token amount to deposit
    * @return shareAmount cToken amount
    */
function deposit(address token, uint256 amount) { ... }

/**
    * @notice Withdraw underlying assets from Compound
    * @param shareAmount Amount of cTokens to redeem
    * @return withdrawAmount Amount of underlying assets withdrawn
    */
function withdraw(address token, uint256 shareAmount) { ... }

However, if we examine the code in these functions, there is no movement of the assets to Compound. Instead, they sit in the Hard Vault and doesn't earn any yield.

Impact

Users who may expect to be earning yield on their underlying tokens will not be.

Code Snippet

https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/vault/HardVault.sol#L68-L116

Tool used

Manual Review

Recommendation

Either add the functionality to the Hard Vault to have the assets pulled from the ERC1155 and deposited to the Compound fork, or change the comments and docs to be clear that such underlying assets will not be receiving any yield.

The original report as published on Sherlock, by obront. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the deposit and withdraw functions were implemented without the logic to interact with the Compound fork, despite comments and documentation claiming otherwise.

Impact

Users who expected to earn yield on their deposited tokens will not earn any.

What the attacker needed

None

The fix

Either add the functionality to deposit assets to the Compound fork, or update the comments and documentation to clarify that assets will not earn yield.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A vault is a smart contract where users deposit tokens. The documentation said the vault would put those tokens into Compound, a lending service, to earn interest. But the code never does that, so the tokens just sit there and earn nothing.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by obront

View all

46 more disclosed reports, best first.

More from Blueberry Update #3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.