Vault cannot be deployed properly for newer Curve pools
Source: https://github.com/sherlock-audit/2023-02-notional-judging/issues/22
Found by
usmannk
Summary
New Curve pools have a different ABI than the one that the vaults attempt to use. Not differentiating between the two will lead to silent failures when vaults are deployed for new pools.
Vulnerability Detail
During the deploy process the leveraged vault attempts to obtain the Curve pool's LP token address by calling CURVE_POOL.lp_token(). However, for new pools such as CRV/ETH (https://etherscan.io/address/0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511#code), there is no lp_token member. Instead calling lp_token() will trigger the fallback function. For these pools, the token is obtained by calling token().
Impact
The lp token's address will be set to the 0 address and later calls to functions such as totalSupply will fail, causing the vault to be in a stuck state.
Code Snippet
Tool used
Manual Review
Recommendation
Check the version of the target Curve pool and toggle called functions appropiately.
Discussion
jeffywu
Valid
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Notional Update #4. Sherlock made it public on 30 March 2023. Found in the 52 audit contest (finding M-1).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.