diff --git a/README.md b/README.md index b3f94036..38e1aae8 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,11 @@ At times you may need to register additional vault factories for a Geyser. yarn hardhat register-vault-factory --network goerli --geyser 0xdD1B3DD2eAB8376963F964B84f0D13DfC206178f --vault-factory 0x5C7bCEA7a607A6FC065B148A4B7F8F18e83b1d27 ``` +### Transfer Ownership +Ownable contracts can be transferred using the following script: +``` +yarn hardhat transfer-ownership --network goerli --contract 0xdD1B3DD2eAB8376963F964B84f0D13DfC206178f --owner 0xEDBcCA5DfD692bab7656Ab2D4F499B43fA26480B +``` ## Contribute diff --git a/hardhat.config.ts b/hardhat.config.ts index 1675974b..cf9e84ee 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -327,6 +327,18 @@ task('register-vault-factory', 'register a vault factory instance with a Geyser' console.log(`Transaction hash: ${res.hash}`); }) +task('transfer-ownership', 'transfers a contract that implements Ownable to a new owner') + .addParam('contract', 'address of Ownable contract') + .addParam('owner', 'address of new owner') + .setAction(async ({ contract, owner }, { ethers }) => { + const ownable = await ethers.getContractAt( + '@openzeppelin/contracts/access/Ownable.sol:Ownable', + contract, + ) + const res = await ownable.transferOwnership(owner) + console.log(`Transaction hash: ${res.hash}`); + }) + task('lookup-proxy-admin', 'gets the proxy admin of the given contract') .addPositionalParam('address', 'the proxy contract address') .setAction(async ({ address }, { ethers, run, upgrades, network }) => {