Skip to content

Commit

Permalink
Bump upgrade executor
Browse files Browse the repository at this point in the history
  • Loading branch information
gvladika committed Aug 25, 2023
1 parent 69a8c33 commit 1eaf931
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@arbitrum/sdk": "^3.1.3",
"@ethersproject/providers": "^5.7.2",
"@offchainlabs/upgrade-executor": "^1.0.0-beta.2",
"@offchainlabs/upgrade-executor": "1.1.0-beta.0",
"@openzeppelin/contracts": "4.5.0",
"@openzeppelin/contracts-upgradeable": "4.5.2",
"patch-package": "^6.4.7"
Expand Down
21 changes: 21 additions & 0 deletions src/mocks/UpgradeExecutorMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ contract UpgradeExecutorMock is
/// @notice Emitted when an upgrade execution occurs
event UpgradeExecuted(address indexed upgrade, uint256 value, bytes data);

/// @notice Emitted when target call occurs
event TargetCallExecuted(address indexed target, uint256 value, bytes data);

constructor() initializer {}

/// @notice Initialise the upgrade executor
Expand Down Expand Up @@ -58,4 +61,22 @@ contract UpgradeExecutorMock is

emit UpgradeExecuted(upgrade, msg.value, upgradeCallData);
}

/// @notice Execute an upgrade by directly calling target contract
/// @dev Only executor can call this.
function executeCall(address target, bytes memory targetCallData)
public
payable
onlyRole(EXECUTOR_ROLE)
nonReentrant
{
// OZ Address library check if the address is a contract and bubble up inner revert reason
address(target).functionCallWithValue(
targetCallData,
msg.value,
"UpgradeExecutor: inner call failed without reason"
);

emit TargetCallExecuted(target, msg.value, targetCallData);
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,10 @@
"@types/sinon-chai" "^3.2.3"
"@types/web3" "1.0.19"

"@offchainlabs/upgrade-executor@^1.0.0-beta.2":
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/@offchainlabs/upgrade-executor/-/upgrade-executor-1.0.0-beta.2.tgz#b3f9e1ba2e58edf17019249b4663d88567961fec"
integrity sha512-aSjWctspD2QTGXUv0fRHudFrl5oR42nRB/88JUnC9O5tujPyRksM6Y8WyrDNl3eZuqV+L1V76Ui2Av4NrUkd+g==
"@offchainlabs/upgrade-executor@1.1.0-beta.0":
version "1.1.0-beta.0"
resolved "https://registry.yarnpkg.com/@offchainlabs/upgrade-executor/-/upgrade-executor-1.1.0-beta.0.tgz#c4b1375176546a18aaef01a43956abfb58250e0a"
integrity sha512-mpn6PHjH/KDDjNX0pXHEKdyv8m6DVGQiI2nGzQn0JbM1nOSHJpWx6fvfjtH7YxHJ6zBZTcsKkqGkFKDtCfoSLw==
dependencies:
"@openzeppelin/contracts" "4.7.3"
"@openzeppelin/contracts-upgradeable" "4.7.3"
Expand Down

0 comments on commit 1eaf931

Please sign in to comment.