DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

`beginBarnRaiseMigration` doesn't call `UnripeFacet.addMigratedUnderlying` to complete the migration process

Summary

The beginBarnRaiseMigration function is responsible for initiating the migration of the Barn Raise to a new Well. As mentioned in the comments, the migration process in completed by calling UnripeFacet.addMigratedUnderlying.

Vulnerability Details

However, after initiating the migration using LibFertilizer.beginBarnRaiseMigration(well), it does not complete the migration process by calling UnripeFacet.addMigratedUnderlying. Without completing the migration process, the Unripe liquidity will not be added to the new Well, and the Fertilizer purchases may remain disabled, leading to potential disruptions or inconsistencies in the system.

See the following code:

/**
* @notice Begins the process of Migration the Barn Raise to a new Well.
* @param well The address of the Well to migrate to.
* @dev
* Withdraws all underlying Unripe LP tokens to the owner contract.
* Converting, chopping and purchasing Fertilizer will be disabled until the migration is complete.
* The migration process is completed by calling {UnripeFacet.addMigratedUnderlying}.
* After migration, Unripe liquidity will be added into `well`. and Fertilizer purchases can only happen
* with the non-Bean token in `well`.
*
*/
function beginBarnRaiseMigration(address well) external {
LibDiamond.enforceIsOwnerOrContract();
LibFertilizer.beginBarnRaiseMigration(well);
}

Impact

Incomplete migration could lead to inconsistencies in the system, such as missing liquidity in the new Well or disabled functionality for Fertilizer purchases. Users may experience difficulties or limitations in interacting with the system, leading to frustration or loss of trust in the platform.

Tools Used

Manual Review

Recommendations

To address the issue and ensure a complete migration process, you should modify the beginBarnRaiseMigration function to call UnripeFacet.addMigratedUnderlying after call to LibFertilizer.beginBarnRaiseMigration(well) is successful.

Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

Finalize migration

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.