forked from sphinx-labs/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add meta upgrades to root chugsplashmanager
- Loading branch information
1 parent
10494fd
commit 35c7a63
Showing
34 changed files
with
771 additions
and
796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@chugsplash/contracts': patch | ||
'@chugsplash/plugins': patch | ||
'@chugsplash/core': patch | ||
--- | ||
|
||
Add meta upgrades for root ChugSplashManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import { IProxyAdapter } from "../interfaces/IProxyAdapter.sol"; | ||
import { IProxyUpdater } from "../interfaces/IProxyUpdater.sol"; | ||
import { Proxy } from "../libraries/Proxy.sol"; | ||
|
||
/** | ||
* @title DefaultAdapter | ||
* @notice Adapter for the default EIP-1967 proxy used by ChugSplash. | ||
*/ | ||
contract DefaultAdapter is IProxyAdapter { | ||
address public immutable proxyUpdater; | ||
|
||
constructor(address _proxyUpdater) { | ||
proxyUpdater = _proxyUpdater; | ||
} | ||
|
||
/** | ||
* @inheritdoc IProxyAdapter | ||
*/ | ||
function initiateExecution(address payable _proxy) external { | ||
Proxy(_proxy).upgradeTo(proxyUpdater); | ||
} | ||
|
||
/** | ||
* @inheritdoc IProxyAdapter | ||
*/ | ||
function completeExecution(address payable _proxy, address _implementation) external { | ||
Proxy(_proxy).upgradeTo(_implementation); | ||
} | ||
|
||
/** | ||
* @inheritdoc IProxyAdapter | ||
*/ | ||
function setStorage( | ||
address payable _proxy, | ||
bytes32 _key, | ||
uint8 _offset, | ||
bytes memory _segment | ||
) external { | ||
IProxyUpdater(_proxy).setStorage(_key, _offset, _segment); | ||
} | ||
|
||
/** | ||
* @inheritdoc IProxyAdapter | ||
*/ | ||
function changeProxyAdmin(address payable _proxy, address _newAdmin) external { | ||
Proxy(_proxy).changeAdmin(_newAdmin); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.