"AdminUpgradeabilityProxy" hit a require or revert statement somewhere in its constructor

I am experiencing the same thing, and haven’t been able to work out why:

migration js:

const { deployProxy } = require('@openzeppelin/truffle-upgrades');

const Contract = artifacts.require("Contract");

module.exports = async function (deployer) {
  await deployProxy(Contract, [''], { deployer, initializer: 'initialize' });
};

npx truffle version:

Truffle v5.2.6 (core: 5.2.6)
Solidity - 0.8.3 (solc-js)
Node v14.5.0
Web3.js v1.2.9

I’m just trying to deploy this via ganache-cli locally at this point. Here’s the trace:

   Deploying 'AdminUpgradeabilityProxy'
   ------------------------------------

Error:  *** Deployment Failed ***

"AdminUpgradeabilityProxy" hit a require or revert statement somewhere in its constructor. Try:
   * Verifying that your constructor params satisfy all require conditions.
   * Adding reason strings to your require statements.

    at ./node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at deployProxy (./node_modules/@openzeppelin/truffle-upgrades/src/deploy-proxy.ts:62:17)
    at module.exports (./migrations/1_deploy_life.js:6:3)
    at Migration._deploy (./node_modules/truffle/build/webpack:/packages/migrate/Migration.js:79:1)
    at Migration._load (./node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
    at Migration.run (./node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
    at Object.runMigrations (./node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (./node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.runAll (./node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
    at Object.run (./node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
    at runMigrations (./node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
    at Object.run (./node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:228:1)
    at Command.run (./node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.6 (core: 5.2.6)
Node v14.5.0
1 Like

Figure it out.
There was a bug deep in my initializer function.

Apparently, no matter how the initializer fails, the above error is thrown. Would be nice if it percolated up in a future version, but now I know.

1 Like

Hi @heathdutton,

Glad you were able to resolve.

You may also want to create unit tests for your implementation contract to test your initialize.