ProviderError: VM execution error when using proposeUpgrade function

Ahoy, OZeppelin sailors!

Trying to propose upgrade to one of my contracts via proposeUpgrade function and I keep getting ProviderError: VM execution error. for Gnosis chain. Rinkeby went well.

:computer: Environment

I'm using proposals. Trying to create a proposal through API.


I'm duplicating all upgrades on Rinkeby. Rinkeby went fine. I made the proposal and then approved it in Defender. But proposing on xDai causes the problem.

xDai proxy contract - "0xD404Fb7635dB26D783dd8D2DF87Be1c504436268"
Rinkeby proxy contract - "0x6f63293c1250e60DC72797Ee322603E2D22CB2Dd"

:1234: Code to reproduce

The upgrade script I'm running:

const { defender } = require('hardhat')
const { UpalaConstants } = require('@upala/constants')

const UPALA_MANAGER = '0x525437F0C66A85fABf922B2aF642dfBc6BF9EeD5' // todo move to constants

async function main() {
  // get Upala address from constants
  const wallets = await ethers.getSigners()
  const chainId = await wallets[0].getChainId()
  const upalaConst = new UpalaConstants(chainId)
  const upalaAddress = upalaConst.getAddress('Upala')
  console.log('Upgrade proposal for Upala at:', upalaAddress)
  // deploy upgrade
  const nextVersionUpala = await ethers.getContractFactory('Upala')
  const proposal = await defender.proposeUpgrade(upalaAddress, nextVersionUpala, {
    description: 'UIP-24',
    multisig: UPALA_MANAGER,
  console.log('Upgrade proposal created at:', proposal.url)

  .then(() => process.exit(0))
  .catch((error) => {

What I get:

    at HttpProvider.request (/Users/me/Projects/upala/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
    at HDWalletProvider.request (/Users/me/Projects/upala/node_modules/hardhat/src/internal/core/providers/accounts.ts:188:34)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getImplementationAddressFromBeacon (/Users/me/Projects/upala/node_modules/@openzeppelin/upgrades-core/src/impl-address.ts:30:25)
    at async isBeacon (/Users/me/Projects/upala/node_modules/@openzeppelin/upgrades-core/src/beacon.ts:11:5)
    at async Proxy.proposeUpgrade (/Users/me/Projects/upala/node_modules/@openzeppelin/hardhat-defender/src/propose-upgrade.ts:46:16)
    at async main (/Users/me/Projects/upala/scripts/prepare-upgrade.js:15:20)

Repo (includes .openzeppelin folder):

What can I do with this?

All worked!

Had to upgrade from hardhat-defender@^1.6.0 to hardhat-defender@^1.7.0

Also probably the problem was in using as endpoint. It is not stable right now on my PC.

1 Like

Hi @takeshi.reg

Sorry for not getting back sooner but I am glad you found the solution. Also thanks for posting the solution, this will be useful for anyone else running into a similar problem.