Skip to content

Commit

Permalink
Merge pull request #154 from axieinfinity/feature/fix-callback-visibi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
TuDo1403 authored Jul 31, 2024
2 parents a77e54b + d06f76e commit ab9eed2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions script/BaseMigration.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ abstract contract BaseMigration is ScriptExtended {
_injectDependencies();
}

function upgradeCallback(
function _upgradeCallback(
address, /* proxy */
address, /* logic */
uint256, /* callValue */
bytes memory, /* callData */
ProxyInterface /* proxyInterface */
) external virtual { }
) internal virtual { }

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

Expand Down Expand Up @@ -271,7 +271,7 @@ abstract contract BaseMigration is ScriptExtended {
callData: args,
shouldPrompt: true,
proxyInterface: ProxyInterface.Transparent,
upgradeCallback: this.upgradeCallback,
upgradeCallback: _upgradeCallback,
shouldUseCallback: false
}).upgrade();
}
Expand Down
4 changes: 2 additions & 2 deletions script/libraries/LibDeploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct UpgradeInfo {
uint256 callValue;
bytes callData;
ProxyInterface proxyInterface;
function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback;
function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback;
bool shouldUseCallback;
bool shouldPrompt;
}
Expand Down Expand Up @@ -120,7 +120,7 @@ library LibDeploy {
uint256 callValue,
bytes memory callData,
bool shouldPrompt,
function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback,
function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback,
bool shouldUseCallback
) internal validateUpgrade(proxy, logic, shouldPrompt) {
if (shouldUseCallback) {
Expand Down
10 changes: 5 additions & 5 deletions test/LibDeploy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract LibDeployTest is Test {
callValue: 0,
callData: abi.encodeCall(MockERC721.initialize, ("Name", "Symbol")),
proxyInterface: ProxyInterface.Transparent,
upgradeCallback: this.emptyFn,
upgradeCallback: emptyFn,
shouldPrompt: false,
shouldUseCallback: false
});
Expand All @@ -56,7 +56,7 @@ contract LibDeployTest is Test {
callValue: 0,
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
proxyInterface: ProxyInterface.Transparent,
upgradeCallback: this.emptyFn,
upgradeCallback: emptyFn,
shouldPrompt: false,
shouldUseCallback: false
});
Expand All @@ -79,7 +79,7 @@ contract LibDeployTest is Test {
callValue: 0,
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
proxyInterface: ProxyInterface.Transparent,
upgradeCallback: this.emptyFn,
upgradeCallback: emptyFn,
shouldPrompt: false,
shouldUseCallback: false
});
Expand Down Expand Up @@ -108,7 +108,7 @@ contract LibDeployTest is Test {
callValue: 0,
callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)),
proxyInterface: ProxyInterface.Transparent,
upgradeCallback: this.emptyFn,
upgradeCallback: emptyFn,
shouldPrompt: false,
shouldUseCallback: false
});
Expand All @@ -122,5 +122,5 @@ contract LibDeployTest is Test {
uint256, /* callValue */
bytes memory, /* callData */
ProxyInterface /* proxyInterface */
) external { }
) internal { }
}

0 comments on commit ab9eed2

Please sign in to comment.