Skip to content
Business logic Audit finding Beginner

Unable to deploy new leverage vault for certain MetaStable Pool

The MetaStable2TokenVaultMixin constructor requires the Balancer Oracle to be enabled on the MetaStable Pool, but the oracle is deprecated and no longer used by Notional. This could prevent deployment of new leverage vaults for pools where the oracle is disabled.

Jeiwan Follow with xiaoming90

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-12-notional-judging/issues/20

Found by

Jeiwan, xiaoming90

Summary

Notional might have an issue deploying the new leverage vault for a MetaStable Pool that does not have Balancer Oracle enabled.

Vulnerability Detail

During deployment, the MetaStable2TokenVaultMixin contract checks if the MetaStable Pool's oracle is enabled. However, the Balancer Oracle has been deprecated (https://docs.balancer.fi/products/oracles-deprecated). In addition, Notional is no longer relying on Balancer Oracle in this iteration. Therefore, there is no need to check if the Balancer Oracle is enabled on the MetaStable Pool.

https://github.com/sherlock-audit/2022-12-notional/blob/main/contracts/vaults/balancer/mixins/MetaStable2TokenVaultMixin.sol#L11

Solidity
File: MetaStable2TokenVaultMixin.sol
11: abstract contract MetaStable2TokenVaultMixin is TwoTokenPoolMixin {
12:     constructor(NotionalProxy notional_, AuraVaultDeploymentParams memory params)
13:         TwoTokenPoolMixin(notional_, params)
14:     {
15:         // The oracle is required for the vault to behave properly
16:         (/* */, /* */, /* */, /* */, bool oracleEnabled) = 
17:             IMetaStablePool(address(BALANCER_POOL_TOKEN)).getOracleMiscData();
18:         require(oracleEnabled);
19:     }

Impact

Notional might have an issue deploying the new leverage vault for a MetaStable Pool that does not have Balancer Oracle enabled. Since Balancer Oracle has been deprecated, the Balancer Oracle will likely be disabled on the MetaStable Pool.

Code Snippet

https://github.com/sherlock-audit/2022-12-notional/blob/main/contracts/vaults/balancer/mixins/MetaStable2TokenVaultMixin.sol#L11

Tool used

Manual Review

Recommendation

Remove the Balancer Oracle check from the constructor.

Diff
    constructor(NotionalProxy notional_, AuraVaultDeploymentParams memory params)
        TwoTokenPoolMixin(notional_, params)
    {
-        // The oracle is required for the vault to behave properly
-        (/* */, /* */, /* */, /* */, bool oracleEnabled) = 
-            IMetaStablePool(address(BALANCER_POOL_TOKEN)).getOracleMiscData();
-        require(oracleEnabled);
    }

Discussion

weitianjie2000

valid, will fix

The original report as published on Sherlock, by Jeiwan. 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

The constructor contains a require statement that checks a deprecated oracle flag which is no longer relevant to the vault's operation.

What the attacker needed

MetaStable Pool with oracle disabled

The fix

The check should be removed from the constructor, and the report notes it will be fixed.

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 smart contract constructor is code that runs once when the contract is first deployed. This constructor checked a setting on an external pool and refused to deploy if that setting was off, even though the setting no longer mattered.

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 Jeiwan

View all

69 more disclosed reports, best first.

More from Notional Update #4

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.