admin.changeAdminForProxy not found


I am using hardhat upgrades and followed the setup steps as shown at the following links:

I am wanting to execute admin.changeAdminForProxy but .admin is not found on upgrades.

In vscode, when I hover over the red line under .admin i get the following error:

Property ‘admin’ does not exist on type ‘{ deployProxy: DeployFunction; upgradeProxy: UpgradeFunction; prepareUpgrade: PrepareUpgradeFunction; }’.ts(2339)

I am trying to execute this method: await upgrades.admin.changeAdminForProxy(Bob.address, Alice.address)

I am lost because these docs say that it should be there:

Any help would be greatly appreciated :slight_smile:


1 Like

it looks like this works / doesn’t fail?

 await upgrades['admin'].changeProxyAdmin(Bob.address, Alice.address)
1 Like

This was an error in our type definitions but it was fixed a few days ago. Please install the latest version of the plugin and it should be fixed.

Yes, indeed it works. The problem is only in the type definitions which is what VSCode checks.

1 Like

Hi @jonericcook,

Just wanted to check that this was resolved after updating to the latest version of the Upgrades Plugin?

Yes, it has been resolved! :call_me_hand:

1 Like