Commit 9a02079e authored by Kelvin Fichter's avatar Kelvin Fichter

feat(ctb): make Proxy inheritable

Makes the Proxy contract inheritable by making external functions into
(public virtual) functions. Does not impact generated bytecode or gas
snapshot.
parent 0fad37ea
---
'@eth-optimism/contracts-bedrock': patch
---
Makes the Proxy contract inheritable by making functions (public virtual).
...@@ -84,7 +84,7 @@ contract Proxy { ...@@ -84,7 +84,7 @@ contract Proxy {
* *
* @param _implementation Address of the implementation contract. * @param _implementation Address of the implementation contract.
*/ */
function upgradeTo(address _implementation) external proxyCallIfNotAdmin { function upgradeTo(address _implementation) public virtual proxyCallIfNotAdmin {
_setImplementation(_implementation); _setImplementation(_implementation);
} }
...@@ -96,8 +96,9 @@ contract Proxy { ...@@ -96,8 +96,9 @@ contract Proxy {
* @param _data Calldata to delegatecall the new implementation with. * @param _data Calldata to delegatecall the new implementation with.
*/ */
function upgradeToAndCall(address _implementation, bytes calldata _data) function upgradeToAndCall(address _implementation, bytes calldata _data)
external public
payable payable
virtual
proxyCallIfNotAdmin proxyCallIfNotAdmin
returns (bytes memory) returns (bytes memory)
{ {
...@@ -112,7 +113,7 @@ contract Proxy { ...@@ -112,7 +113,7 @@ contract Proxy {
* *
* @param _admin New owner of the proxy contract. * @param _admin New owner of the proxy contract.
*/ */
function changeAdmin(address _admin) external proxyCallIfNotAdmin { function changeAdmin(address _admin) public virtual proxyCallIfNotAdmin {
_changeAdmin(_admin); _changeAdmin(_admin);
} }
...@@ -121,7 +122,7 @@ contract Proxy { ...@@ -121,7 +122,7 @@ contract Proxy {
* *
* @return Owner address. * @return Owner address.
*/ */
function admin() external proxyCallIfNotAdmin returns (address) { function admin() public virtual proxyCallIfNotAdmin returns (address) {
return _getAdmin(); return _getAdmin();
} }
...@@ -130,7 +131,7 @@ contract Proxy { ...@@ -130,7 +131,7 @@ contract Proxy {
* *
* @return Implementation address. * @return Implementation address.
*/ */
function implementation() external proxyCallIfNotAdmin returns (address) { function implementation() public virtual proxyCallIfNotAdmin returns (address) {
return _getImplementation(); return _getImplementation();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment