@@ -15,6 +15,7 @@ import {EPNSCommProxy} from "contracts/PushComm/EPNSCommProxy.sol";
15
15
import {EPNSCommAdmin} from "contracts/PushComm/EPNSCommAdmin.sol " ;
16
16
import {PushMigrationHelper} from "contracts/token/PushMigration.sol " ;
17
17
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol " ;
18
+ import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol " ;
18
19
19
20
import {Actors} from "./utils/Actors.sol " ;
20
21
import {Events} from "./utils/Events.sol " ;
@@ -35,6 +36,7 @@ abstract contract BaseTest is Test, Constants, Events {
35
36
PushMigrationHelper public pushMigrationHelper;
36
37
PushMigrationHelper public pushMigrationHelperProxy;
37
38
TransparentUpgradeableProxy public pushMigrationProxy;
39
+ ProxyAdmin public pushProxyAdmin;
38
40
39
41
/* ***************
40
42
Main Actors in Test
@@ -79,12 +81,14 @@ abstract contract BaseTest is Test, Constants, Events {
79
81
tim_push_holder: createActor ("tim_push_holder " )
80
82
});
81
83
84
+ changePrank (actor.admin);
82
85
pushNttToken = new Push (actor.admin);
86
+ pushProxyAdmin = new ProxyAdmin ();
83
87
84
88
// Initialize pushMigration proxy admin and proxy contract
85
89
pushMigrationProxy = new TransparentUpgradeableProxy (
86
90
address (pushMigrationHelper),
87
- actor.admin ,
91
+ address (pushProxyAdmin) ,
88
92
abi.encodeWithSignature (
89
93
"initialize(address,address) " ,
90
94
actor.admin,
@@ -95,13 +99,14 @@ abstract contract BaseTest is Test, Constants, Events {
95
99
address (pushMigrationProxy)
96
100
);
97
101
// set governance as minter of ntt token
98
- vm. prank (actor.admin);
102
+ changePrank (actor.admin);
99
103
pushNttToken.setMinter (actor.governance);
100
104
105
+ epnsCoreProxyAdmin = new EPNSCoreAdmin (actor.admin);
101
106
// Initialize coreMock proxy admin and coreProxy contract
102
107
epnsCoreProxy = new EPNSCoreProxy (
103
108
address (coreMock),
104
- actor.admin ,
109
+ address (epnsCoreProxyAdmin) ,
105
110
actor.admin,
106
111
address (pushToken),
107
112
address (0 ), // WETH Address
@@ -111,25 +116,14 @@ abstract contract BaseTest is Test, Constants, Events {
111
116
address (0 ), // aDai address
112
117
0
113
118
);
114
- address admin = address (
115
- uint160 (
116
- uint256 (
117
- vm.load (
118
- address (epnsCoreProxy),
119
- 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
120
- )
121
- )
122
- )
123
- );
124
- vm.prank (actor.admin);
125
- EPNSCoreAdmin (admin).upgradeAndCall (
119
+ changePrank (actor.admin);
120
+ epnsCoreProxyAdmin.upgrade (
126
121
ITransparentUpgradeableProxy (address (epnsCoreProxy)),
127
- address (coreProxy),
128
- ""
122
+ address (coreProxy)
129
123
);
130
124
131
125
coreProxy = PushCoreV3 (address (epnsCoreProxy));
132
- vm. prank (tokenDistributor);
126
+ changePrank (tokenDistributor);
133
127
pushToken.transfer (address (coreProxy), 1 ether);
134
128
135
129
// Initialize comm proxy admin and commProxy contract
@@ -143,7 +137,7 @@ abstract contract BaseTest is Test, Constants, Events {
143
137
commProxy = PushCommV3 (address (epnsCommProxy));
144
138
145
139
// Set-up Core Address in Comm & Vice-Versa
146
- vm. startPrank (actor.admin);
140
+ changePrank (actor.admin);
147
141
commProxy.setEPNSCoreAddress (address (coreProxy));
148
142
commProxy.setPushTokenAddress (address (pushToken));
149
143
coreProxy.setEpnsCommunicatorAddress (address (commProxy));
0 commit comments