0

I have erc721 uups proxy contract with initializer as :

    function initialize(address owner) public initializer {
    __ERC721_init("demo", "demo");
    __ERC721URIStorage_init();
    __Pausable_init();
    __AccessControl_init();
    __ERC721Burnable_init();
    __UUPSUpgradeable_init();

    _grantRole(DEFAULT_ADMIN_ROLE, owner);
    _grantRole(PAUSER_ROLE, owner);
    _grantRole(MINTER_ROLE, owner);
    _grantRole(UPGRADER_ROLE, owner);
}

Now I am writing a test case for this contract using hardhat toolbox typescript version in a hardhat project.

In my testcase I first have to deploy this contract. My code for that is

const Demo = await ethers.getContractFactory("demo");
const demo = await upgrades.deployProxy(Demo, [owner.address], {
    kind: "uups",
    initializer: "initialize",
});

await demo.deployed();

The error I get in running this code is at that deployment code as :

Error: types/values length mismatch (count={"types":1,"values":0}, value={"types":[{"name":"owner","type":"address","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"address","_isParamType":true}],"values":[]}, code=INVALID_ARGUMENT, version=abi/5.7.0)
Jamiu S.
  • 5,257
  • 5
  • 12
  • 34
Mueed
  • 31
  • 5

1 Answers1

0

OpenZepplin Upgrades module uses autogenerated .openzepplin folder to store network related data. In my case, I had an empty folder of .openzepplin so I deleted that folder and upon running my tests again a new .openzepplin folder with new configurations was autogenerated. Hence the upgrade.deployProxy function which was causing issues In my case was resolved.

Mueed
  • 31
  • 5