From 41e84833603e46cdb37092aeccba829ae67b38e9 Mon Sep 17 00:00:00 2001 From: Aaron Alderman Date: Wed, 19 Jul 2023 13:10:32 +0800 Subject: [PATCH] Change owner script --- scripts/change-owner.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/change-owner.ts diff --git a/scripts/change-owner.ts b/scripts/change-owner.ts new file mode 100644 index 0000000..c1b5349 --- /dev/null +++ b/scripts/change-owner.ts @@ -0,0 +1,25 @@ +import { getContractAt } from './helper'; +import marketAddresses from '../deployments/SY-swETH.json'; +import { SwETHSY } from '../typechain-types'; +import { PENDLE_MULTISIG } from './consts'; + +async function main() { + const SY = await getContractAt('SwETHSY', marketAddresses.SY); + + console.log('Transferring ownership to: ', PENDLE_MULTISIG); + + const tx = await SY.transferOwnership(PENDLE_MULTISIG, false, false); // direct=false, renounce=false + + console.log('Waiting for transaction confirmation'); + + await tx.wait(); + + console.log('Ownership transferred'); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});