Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : Upgrader
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface Proxy { function upgradeTo(address newImplementation) external; } contract Upgrader { event Upgraded(address indexed proxyAddress, address indexed implementationAddress); address public admin; address public pendingAdmin; address public superAdmin; address public pendingSuperAdmin; constructor(address adminAddress, address superAdminAddress) public { admin = adminAddress; superAdmin = superAdminAddress; } // ADMIN // ************************************************************************************* function setPendingAdmin(address newPendingAdmin) public { require(msg.sender == admin, 'not admin'); pendingAdmin = newPendingAdmin; } function acceptAdmin() public { require(msg.sender == pendingAdmin && msg.sender != address(0), 'not pendingAdmin'); admin = pendingAdmin; pendingAdmin = address(0); } function setPendingSuperAdmin(address newPendingSuperAdmin) public { require(msg.sender == superAdmin, 'not superAdmin'); pendingSuperAdmin = newPendingSuperAdmin; } function acceptSuperAdmin() public { require(msg.sender == pendingSuperAdmin && msg.sender != address(0), 'not pendingSuperAdmin'); superAdmin = pendingSuperAdmin; pendingSuperAdmin = address(0); } // UPGRADE // ************************************************************************************* function upgrade(address proxyAddress, address implementationAddress) external { require(msg.sender == admin || msg.sender == superAdmin, 'not admin'); Proxy proxy = Proxy(proxyAddress); proxy.upgradeTo(implementationAddress); emit Upgraded(proxyAddress, implementationAddress); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.