From 00f101606c1a209d919e5e82bde00b7a0ed8e09c Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Fri, 15 Dec 2023 21:42:54 +0200 Subject: [PATCH] Change admin. --- .../testnet/recoverfunds/002_change_admin.ts | 18 ++++++++++++++++++ .../src/dependencies/IDefaultProxyAdmin.sol | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 contracts/deployment_scripts/testnet/recoverfunds/002_change_admin.ts create mode 100644 contracts/src/dependencies/IDefaultProxyAdmin.sol diff --git a/contracts/deployment_scripts/testnet/recoverfunds/002_change_admin.ts b/contracts/deployment_scripts/testnet/recoverfunds/002_change_admin.ts new file mode 100644 index 0000000000..a3156e394d --- /dev/null +++ b/contracts/deployment_scripts/testnet/recoverfunds/002_change_admin.ts @@ -0,0 +1,18 @@ +import {HardhatRuntimeEnvironment} from 'hardhat/types'; +import {DeployFunction} from 'hardhat-deploy/types'; + + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const {deployer} = await hre.getNamedAccounts(); + const ethers = hre.ethers; + const proxyAdmin =await ethers.getContractAt('IDefaultProxyAdmin', '0xFFa0feA0cb522f3d0CE644B9a111215ACbEb061B', await ethers.getSigner(deployer)) + const tx = await proxyAdmin.changeProxyAdmin('0xEde0fC70C4B67916B8d2037dE24cD18BF26e5069', '0xeA052c9635F1647A8a199c2315B9A66ce7d1e2a7') + const receipt = await tx.wait(); + if (receipt.status != 1) { + console.error('Unable to change proxy admin'); + throw Error('Failed: unable to change admin'); + } +}; + +export default func; +// No dependencies \ No newline at end of file diff --git a/contracts/src/dependencies/IDefaultProxyAdmin.sol b/contracts/src/dependencies/IDefaultProxyAdmin.sol new file mode 100644 index 0000000000..a931063fad --- /dev/null +++ b/contracts/src/dependencies/IDefaultProxyAdmin.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Apache 2 +pragma solidity ^0.8.0; + + +interface IDefaultProxyAdmin { + function changeProxyAdmin(address proxy, address newAdmin) external; +} \ No newline at end of file