Failed to Deploy Upgradeable contract - TransparentUpgradeableProxy - Address: low-level delegate call failed

Hi folks,

I’m very new at developing smart contract, but very exciting to learn more because I’ve just got involved into the team for develop our own NFT Smart Contract based on EIP 721. And after reading some documents, I decided to create the contract upgradeable. But when I tried to do truffle migrate, it failed when deploying TransparentUpgradeableProxy, with the following error :

   Deploying 'TransparentUpgradeableProxy'
   ---------------------------------------

Error:  *** Deployment Failed ***

"TransparentUpgradeableProxy" hit a require or revert statement with the following reason given:
   * Address: low-level delegate call failed

    at <my-project>/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1

Is there any compatibility issue or anything? I’m kinda confused with this error message, and couldn’t find any solutions right now.

:1234: Code to reproduce

I’m writing the contract with extending ERC721URIStorageUpgradeable, and OwnableUpgradeable

contract MyAwesomeContract is ERC721URIStorageUpgradeable, OwnableUpgradeable {}

:computer: Environment

I’m using node node 16 on Mac M1

"dependencies": {
    "@openzeppelin/contracts-upgradeable": "^4.1.0"
  },
  "devDependencies": {
    "@openzeppelin/truffle-upgrades": "^1.7.1",
    "truffle": "^5.3.12"
  },

I’m deploying to my local ganache GUI network, here’s some of my truffle-config.js

  networks: {
    // Useful for testing. The `development` name is special - truffle uses it by default
    // if it's defined here and no other network is specified at the command line.
    // You should run a client (like ganache-cli, geth or parity) in a separate terminal
    // tab if you use this network and you must also set the `host`, `port` and `network_id`
    // options below to some value.
    //
    development: {
     host: "127.0.0.1",     // Localhost (default: none)
     port: 7545,            // Standard Ethereum port (default: none)
     network_id: "*",       // Any network (default: none)
    },
...
}

Hi folks, I think I’ve missed a huge detail from my question that leads to my issues. So, on my contract, I have my custom variables that hold the information of a list of valid tokens that used for verifying the mint process.

contract MyAwesomeContract is ERC721URIStorageUpgradeable, OwnableUpgradeable {
  
  // My custom enumerable set for type String. Based on https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/utils/structs/EnumerableSetUpgradeable.sol
  using EnumerableSetString for EnumerableSetString.StringSet;
  using CountersUpgradeable for CountersUpgradeable.Counter;

  // Hold all valid Tokens
  EnumerableSetString.StringSet private validTokens;

  // Keep counter for tokenIds
  CountersUpgradeable.Counter private _tokenIds;

  function initialize(string memory name_, string memory symbol_, string[] calldata listOfTokens) initializer public {
    __ERC721_init(name_, symbol_);
    for (uint256 idx = 0; idx < listOfTokens.length; idx++) {
      validTokens.add(listOfTokens[idx]);
    }
}
...
}

and here’s my Migration code

// 2_deploy_contract.js

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

const AwesomeContract = artifacts.require("MyAwesomeContract");

module.exports = async function (deployer) {
  const args = [
    "SomeContract",
    "SC",
    ["1234", "56789", ] // I set around 50 item
  ]
  const instance = await deployProxy(AwesomeContract, args, { deployer });
  console.log("Contract deployed", instance.address);
}

Maybe I’ll revise the question to : What’s really happened? Because when I pass empty array on initialization, it works without any issue.