Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit acf27c6

Browse files
committed
test: upgrade lens
1 parent dad6d6a commit acf27c6

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
FOUNDRY_FORK_BLOCK_NUMBER?=29116728
3838
FOUNDRY_CONTRACT_PATTERN_INVERSE=(Fees|IncentivesVault|Rewards)
3939
endif
40-
40+
4141
FOUNDRY_CHAIN_ID=137
4242
FOUNDRY_FORK_BLOCK_NUMBER?=22116728
4343
endif
@@ -121,7 +121,7 @@ single-% s-%:
121121
storage-layout-generate:
122122
@./scripts/storage-layout.sh generate snapshots/.storage-layout-${PROTOCOL} Morpho RewardsManager Lens
123123

124-
storage-layout-check:
124+
storage-layout-check:
125125
@./scripts/storage-layout.sh check snapshots/.storage-layout-${PROTOCOL} Morpho RewardsManager Lens
126126

127127
config:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// SPDX-License-Identifier: GNU AGPLv3
2+
pragma solidity 0.8.13;
3+
4+
import "./setup/TestSetup.sol";
5+
6+
contract TestBorrow is TestSetup {
7+
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;
8+
using WadRayMath for uint256;
9+
using Math for uint256;
10+
11+
function testUpgradeLens() public {
12+
Lens lensImplV2 = new Lens(address(morpho));
13+
14+
(
15+
uint256 p2pSupplyIndexBefore,
16+
uint256 p2pBorrowIndexBefore,
17+
uint256 poolSupplyIndexBefore,
18+
uint256 poolBorrowIndexBefore
19+
) = lens.getIndexes(aStEth);
20+
21+
vm.prank(proxyAdmin.owner());
22+
proxyAdmin.upgrade(lensProxy, address(lensImplV2));
23+
24+
(
25+
uint256 p2pSupplyIndexAfter,
26+
uint256 p2pBorrowIndexAfter,
27+
uint256 poolSupplyIndexAfter,
28+
uint256 poolBorrowIndexAfter
29+
) = lens.getIndexes(aStEth);
30+
31+
assertEq(p2pSupplyIndexAfter, p2pSupplyIndexBefore);
32+
assertEq(p2pBorrowIndexAfter, p2pBorrowIndexBefore);
33+
assertEq(poolSupplyIndexAfter, poolSupplyIndexBefore);
34+
assertEq(poolBorrowIndexAfter, poolBorrowIndexBefore);
35+
}
36+
}

0 commit comments

Comments
 (0)