Skip to content

Commit ab9eed2

Browse files
authored
Merge pull request #154 from axieinfinity/feature/fix-callback-visibility
2 parents a77e54b + d06f76e commit ab9eed2

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

script/BaseMigration.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ abstract contract BaseMigration is ScriptExtended {
3030
_injectDependencies();
3131
}
3232

33-
function upgradeCallback(
33+
function _upgradeCallback(
3434
address, /* proxy */
3535
address, /* logic */
3636
uint256, /* callValue */
3737
bytes memory, /* callData */
3838
ProxyInterface /* proxyInterface */
39-
) external virtual { }
39+
) internal virtual { }
4040

4141
function _sharedArguments() internal virtual returns (bytes memory rawSharedArgs);
4242

@@ -271,7 +271,7 @@ abstract contract BaseMigration is ScriptExtended {
271271
callData: args,
272272
shouldPrompt: true,
273273
proxyInterface: ProxyInterface.Transparent,
274-
upgradeCallback: this.upgradeCallback,
274+
upgradeCallback: _upgradeCallback,
275275
shouldUseCallback: false
276276
}).upgrade();
277277
}

script/libraries/LibDeploy.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct UpgradeInfo {
3232
uint256 callValue;
3333
bytes callData;
3434
ProxyInterface proxyInterface;
35-
function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback;
35+
function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback;
3636
bool shouldUseCallback;
3737
bool shouldPrompt;
3838
}
@@ -120,7 +120,7 @@ library LibDeploy {
120120
uint256 callValue,
121121
bytes memory callData,
122122
bool shouldPrompt,
123-
function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback,
123+
function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback,
124124
bool shouldUseCallback
125125
) internal validateUpgrade(proxy, logic, shouldPrompt) {
126126
if (shouldUseCallback) {

test/LibDeploy.t.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ contract LibDeployTest is Test {
3131
callValue: 0,
3232
callData: abi.encodeCall(MockERC721.initialize, ("Name", "Symbol")),
3333
proxyInterface: ProxyInterface.Transparent,
34-
upgradeCallback: this.emptyFn,
34+
upgradeCallback: emptyFn,
3535
shouldPrompt: false,
3636
shouldUseCallback: false
3737
});
@@ -56,7 +56,7 @@ contract LibDeployTest is Test {
5656
callValue: 0,
5757
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
5858
proxyInterface: ProxyInterface.Transparent,
59-
upgradeCallback: this.emptyFn,
59+
upgradeCallback: emptyFn,
6060
shouldPrompt: false,
6161
shouldUseCallback: false
6262
});
@@ -79,7 +79,7 @@ contract LibDeployTest is Test {
7979
callValue: 0,
8080
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
8181
proxyInterface: ProxyInterface.Transparent,
82-
upgradeCallback: this.emptyFn,
82+
upgradeCallback: emptyFn,
8383
shouldPrompt: false,
8484
shouldUseCallback: false
8585
});
@@ -108,7 +108,7 @@ contract LibDeployTest is Test {
108108
callValue: 0,
109109
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
110110
proxyInterface: ProxyInterface.Transparent,
111-
upgradeCallback: this.emptyFn,
111+
upgradeCallback: emptyFn,
112112
shouldPrompt: false,
113113
shouldUseCallback: false
114114
});
@@ -122,5 +122,5 @@ contract LibDeployTest is Test {
122122
uint256, /* callValue */
123123
bytes memory, /* callData */
124124
ProxyInterface /* proxyInterface */
125-
) external { }
125+
) internal { }
126126
}

0 commit comments

Comments
 (0)