defender.proposeUpgrade - Defender undefined

Hi there,

I was following this tutorial: https://docs.openzeppelin.com/defender/guide-upgrades

And I’ve been able to setup everything, but got stuck at the end in the script ‘propose-upgrade.js’:

When running it returns “proposeUpgrade() of undefined” meaning “defender” is empty and the const { defender } = require("hardhat"); is not working, I’ve tried to connect directly to “hardhat” without redeclaring as defender, but it seems that proposeUpgrade is not there any thoughts?

I’m running the latest “hardhat” version via npm install hardhat

Any help would be awesome and thank you for your amazing works!

Best

1 Like

Found solution :smiley:

I’ve forgot to import require('@openzeppelin/hardhat-defender'); in the hardhat-config.js and then in the propose-transfer.js to use defender.defender.proposeUpgrade(X,Y) ← this is the only changes wrt to the documentation :slight_smile:

3 Likes

Hi @wasnaga,

Welcome to the community :wave:

Glad you were able to resolve. Do we need to update the documentation?

We do regular webinars on Defender. I recommend attending if you haven’t already. Our next one is: Webinar: Introduction to OpenZeppelin Defender - Wednesday 31 March 2021