Fix TransparentUpgradeableProxy's transparency (#4154)
Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
(cherry picked from commit 5523c1482b)
This commit is contained in:
committed by
Francisco Giordano
parent
8dfeb5d79e
commit
c01ea99123
@ -18,7 +18,7 @@ contract ProxyAdmin is Ownable {
|
||||
*
|
||||
* - This contract must be the admin of `proxy`.
|
||||
*/
|
||||
function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
|
||||
function getProxyImplementation(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {
|
||||
// We need to manually run the static call since the getter cannot be flagged as view
|
||||
// bytes4(keccak256("implementation()")) == 0x5c60da1b
|
||||
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
|
||||
@ -33,7 +33,7 @@ contract ProxyAdmin is Ownable {
|
||||
*
|
||||
* - This contract must be the admin of `proxy`.
|
||||
*/
|
||||
function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
|
||||
function getProxyAdmin(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {
|
||||
// We need to manually run the static call since the getter cannot be flagged as view
|
||||
// bytes4(keccak256("admin()")) == 0xf851a440
|
||||
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440");
|
||||
@ -48,7 +48,7 @@ contract ProxyAdmin is Ownable {
|
||||
*
|
||||
* - This contract must be the current admin of `proxy`.
|
||||
*/
|
||||
function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {
|
||||
function changeProxyAdmin(ITransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {
|
||||
proxy.changeAdmin(newAdmin);
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ contract ProxyAdmin is Ownable {
|
||||
*
|
||||
* - This contract must be the admin of `proxy`.
|
||||
*/
|
||||
function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {
|
||||
function upgrade(ITransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {
|
||||
proxy.upgradeTo(implementation);
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ contract ProxyAdmin is Ownable {
|
||||
* - This contract must be the admin of `proxy`.
|
||||
*/
|
||||
function upgradeAndCall(
|
||||
TransparentUpgradeableProxy proxy,
|
||||
ITransparentUpgradeableProxy proxy,
|
||||
address implementation,
|
||||
bytes memory data
|
||||
) public payable virtual onlyOwner {
|
||||
|
||||
Reference in New Issue
Block a user