@@ -139,7 +139,8 @@ abstract contract BaseMigration is ScriptExtended {
139
139
string memory contractName = CONFIG.getContractName (contractType);
140
140
141
141
address logic = _deployLogic (contractType, argsLogicConstructor);
142
- string memory proxyAbsolutePath = "./out/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json " ;
142
+ string memory proxyAbsolutePath =
143
+ "./out/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json " ;
143
144
uint256 proxyNonce = vm.getNonce (sender ());
144
145
address proxyAdmin = _getProxyAdmin ();
145
146
assertTrue (proxyAdmin != address (0x0 ), "BaseMigration: Null ProxyAdmin " );
@@ -201,13 +202,17 @@ abstract contract BaseMigration is ScriptExtended {
201
202
proxy = _upgradeProxy (contractType, arguments ());
202
203
}
203
204
204
- function _upgradeProxy (TContract contractType , bytes memory args )
205
+ function _upgradeProxy (TContract contractType , bytes memory args ) internal virtual returns (address payable proxy ) {
206
+ proxy = _upgradeProxy (contractType, args, EMPTY_ARGS);
207
+ }
208
+
209
+ function _upgradeProxy (TContract contractType , bytes memory args , bytes memory argsLogicConstructor )
205
210
internal
206
211
virtual
207
212
logFn (string .concat ("_upgradeProxy " , TContract.unwrap (contractType).unpackOne ()))
208
213
returns (address payable proxy )
209
214
{
210
- address logic = _deployLogic (contractType);
215
+ address logic = _deployLogic (contractType, argsLogicConstructor );
211
216
proxy = CONFIG.getAddress (network (), contractType);
212
217
_upgradeRaw (proxy.getProxyAdmin (), proxy, logic, args);
213
218
}
@@ -252,7 +257,7 @@ abstract contract BaseMigration is ScriptExtended {
252
257
}
253
258
254
259
function _upgradeRaw (address proxyAdmin , address payable proxy , address logic , bytes memory args ) internal virtual {
255
- if (logic.codehash == payable (proxyAdmin ).getProxyImplementation ({ nullCheck: true }).codehash) {
260
+ if (logic.codehash == payable (proxy ).getProxyImplementation ({ nullCheck: true }).codehash) {
256
261
console.log ("BaseMigration: Logic is already upgraded! " .yellow ());
257
262
return ;
258
263
}
0 commit comments