@@ -15,6 +15,7 @@ import {EPNSCommProxy} from "contracts/PushComm/EPNSCommProxy.sol";
1515import {EPNSCommAdmin} from "contracts/PushComm/EPNSCommAdmin.sol " ;
1616import {PushMigrationHelper} from "contracts/token/PushMigration.sol " ;
1717import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol " ;
18+ import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol " ;
1819
1920import {Actors} from "./utils/Actors.sol " ;
2021import {Events} from "./utils/Events.sol " ;
@@ -35,6 +36,7 @@ abstract contract BaseTest is Test, Constants, Events {
3536 PushMigrationHelper public pushMigrationHelper;
3637 PushMigrationHelper public pushMigrationHelperProxy;
3738 TransparentUpgradeableProxy public pushMigrationProxy;
39+ ProxyAdmin public pushProxyAdmin;
3840
3941 /* ***************
4042 Main Actors in Test
@@ -79,12 +81,14 @@ abstract contract BaseTest is Test, Constants, Events {
7981 tim_push_holder: createActor ("tim_push_holder " )
8082 });
8183
84+ changePrank (actor.admin);
8285 pushNttToken = new Push (actor.admin);
86+ pushProxyAdmin = new ProxyAdmin ();
8387
8488 // Initialize pushMigration proxy admin and proxy contract
8589 pushMigrationProxy = new TransparentUpgradeableProxy (
8690 address (pushMigrationHelper),
87- actor.admin ,
91+ address (pushProxyAdmin) ,
8892 abi.encodeWithSignature (
8993 "initialize(address,address) " ,
9094 actor.admin,
@@ -95,13 +99,14 @@ abstract contract BaseTest is Test, Constants, Events {
9599 address (pushMigrationProxy)
96100 );
97101 // set governance as minter of ntt token
98- vm. prank (actor.admin);
102+ changePrank (actor.admin);
99103 pushNttToken.setMinter (actor.governance);
100104
105+ epnsCoreProxyAdmin = new EPNSCoreAdmin (actor.admin);
101106 // Initialize coreMock proxy admin and coreProxy contract
102107 epnsCoreProxy = new EPNSCoreProxy (
103108 address (coreMock),
104- actor.admin ,
109+ address (epnsCoreProxyAdmin) ,
105110 actor.admin,
106111 address (pushToken),
107112 address (0 ), // WETH Address
@@ -111,25 +116,14 @@ abstract contract BaseTest is Test, Constants, Events {
111116 address (0 ), // aDai address
112117 0
113118 );
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 (
126121 ITransparentUpgradeableProxy (address (epnsCoreProxy)),
127- address (coreProxy),
128- ""
122+ address (coreProxy)
129123 );
130124
131125 coreProxy = PushCoreV3 (address (epnsCoreProxy));
132- vm. prank (tokenDistributor);
126+ changePrank (tokenDistributor);
133127 pushToken.transfer (address (coreProxy), 1 ether);
134128
135129 // Initialize comm proxy admin and commProxy contract
@@ -143,7 +137,7 @@ abstract contract BaseTest is Test, Constants, Events {
143137 commProxy = PushCommV3 (address (epnsCommProxy));
144138
145139 // Set-up Core Address in Comm & Vice-Versa
146- vm. startPrank (actor.admin);
140+ changePrank (actor.admin);
147141 commProxy.setEPNSCoreAddress (address (coreProxy));
148142 commProxy.setPushTokenAddress (address (pushToken));
149143 coreProxy.setEpnsCommunicatorAddress (address (commProxy));
0 commit comments