Skip to content

Commit bc28cf5

Browse files
committed
add to post deployment check
1 parent 5fb1d3d commit bc28cf5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

contracts/foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude_lints = ["mixed-case-variable", "mixed-case-function", "screaming-snake-
1515

1616
[profile.deploy]
1717
optimizer = true
18-
optimizer_runs = 200
18+
optimizer_runs = 9999
1919

2020
[profile.fuzz]
2121
optimizer = true

contracts/script/utils/PostDeployment.s.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ contract PostDeploymentScript is BaseScript, Test {
2121
address VAPP = readAddress("VAPP");
2222
address VAPP_IMPL = readAddress("VAPP_IMPL");
2323
address STAKING = readAddress("STAKING");
24+
address STAKING_IMPL = readAddress("STAKING_IMPL");
2425
address PROVE = readAddress("PROVE");
2526
address I_PROVE = readAddress("I_PROVE");
2627
address GOVERNOR = readAddress("GOVERNOR");
2728

2829
_checkVAppImpl(VAPP, VAPP_IMPL);
2930
_checkVApp(VAPP, STAKING, PROVE, I_PROVE);
31+
_checkStakingImpl(STAKING, STAKING_IMPL);
3032
_checkStaking(STAKING, VAPP, PROVE, I_PROVE);
3133
_checkGovernor(GOVERNOR, I_PROVE);
3234
_checkIProve(I_PROVE, STAKING, PROVE);
@@ -69,6 +71,16 @@ contract PostDeploymentScript is BaseScript, Test {
6971
assertEq(vapp.timestamp(), 0);
7072
}
7173

74+
function _checkStakingImpl(address _staking, address _stakingImpl) internal view {
75+
bytes32 implRaw = vm.load(_staking, _IMPL_SLOT);
76+
address currentImpl = address(uint160(uint256(implRaw)));
77+
assertEq(
78+
currentImpl,
79+
_stakingImpl,
80+
"staking implementation address mismatch (may have been upgraded)"
81+
);
82+
}
83+
7284
function _checkStaking(address _staking, address _vapp, address _prove, address _iProve)
7385
internal
7486
view

0 commit comments

Comments
 (0)