Odd Tartan Gerbil
Medium
The commented-out code in migrate_NumaV1V2
will cause incomplete functionality, which may lead to migration failures or loss of funds.
In vaultV2Deployer.sol#L78
, the migrate_NumaV1V2
function contains commented-out code, which prevents the migration logic from executing as intended.
- Admin needs to deploy the contract with the incomplete
migrate_NumaV1V2
function. - The contract needs to be called with an old vault address for migration.
- An old vault contract must be available for migration to work correctly.
- An admin calls
migrate_NumaV1V2(address _vaultOldAddress)
. - The commented-out code prevents the migration logic from executing.
- As a result, no action is taken, leading to failure in migrating funds or setting up parameters correctly.
The migration fails, potentially leaving funds stuck in the old vault or causing an incomplete migration. This can lead to the loss of funds or an incorrect state in the contract.
Numa/contracts/deployment/vaultV2Deployer.sol
function migrate_NumaV1V2(address _vaultOldAddress) public onlyOwner {
// Migration code is commented out
// NumaVaultOld vaultOld = NumaVaultOld(_vaultOldAddress);
// vaultOld.withdrawToken(lstAddress, lstAddress.balanceOf(_vaultOldAddress), address(vault));
// vaultManager.setSellFee(vaultOld.sell_fee());
// vaultManager.setBuyFee(vaultOld.buy_fee());
// uint numaSupplyOld = vaultOld.getNumaSupply();
// vaultManager.syncNumaSupply(numaSupplyOld);
// vault.unpause();
// emit NumaV1V2MigrationCompleted(msg.sender, _vaultOldAddress);
}
Uncomment and complete the migration logic to ensure it performs the required migration tasks. Alternatively, remove the function if it is no longer needed.