@@ -478,9 +478,13 @@ contract MigrationHelperMainnetTest is Test {
478478 migrationHelper = new MigrationHelper (AaveV3Ethereum.POOL, AaveV2Ethereum.POOL);
479479 }
480480
481- function test_reproduction () external {
482- vm.startPrank (0x7A087e630f7d50544513967B1c68839458C16526 );
481+ function test_diff () external {
482+ address user = 0x7A087e630f7d50544513967B1c68839458C16526 ;
483+ vm.startPrank (user);
483484
485+ uint256 aWBTCBefore = IERC20 (AaveV2EthereumAssets.WBTC_A_TOKEN).balanceOf (user);
486+ uint256 aDAIBefore = IERC20 (AaveV2EthereumAssets.DAI_A_TOKEN).balanceOf (user);
487+ uint256 vUSDCBefore = IERC20 (AaveV2EthereumAssets.USDC_V_TOKEN).balanceOf (user);
484488 IERC20 (AaveV2EthereumAssets.WBTC_A_TOKEN).approve (address (migrationHelper), type (uint256 ).max);
485489 IERC20 (AaveV2EthereumAssets.DAI_A_TOKEN).approve (address (migrationHelper), type (uint256 ).max);
486490 ICreditDelegationToken (AaveV3EthereumAssets.USDC_V_TOKEN).approveDelegation (
@@ -500,5 +504,15 @@ contract MigrationHelperMainnetTest is Test {
500504 IMigrationHelper.PermitInput[] memory permits;
501505 IMigrationHelper.CreditDelegationInput[] memory credDel;
502506 migrationHelper.migrate (assetsToMigrate, positionsToRepay, permits, credDel);
507+
508+ uint256 aWBTCAfter = IERC20 (AaveV3EthereumAssets.WBTC_A_TOKEN).balanceOf (user);
509+ uint256 aDAIAfter = IERC20 (AaveV3EthereumAssets.DAI_A_TOKEN).balanceOf (user);
510+ uint256 vUSDCAfter = IERC20 (AaveV3EthereumAssets.USDC_V_TOKEN).balanceOf (user);
511+
512+ // some deviation is expected due to different indexes on both protocol versions
513+ // additionally on wBTC v2 there is a release margin of 10 wei
514+ assertApproxEqAbs (aWBTCBefore, aWBTCAfter, 20 );
515+ assertApproxEqAbs (aDAIBefore, aDAIAfter, 20 );
516+ assertApproxEqAbs (vUSDCBefore, vUSDCAfter, 10 );
503517 }
504518}
0 commit comments