Developers Forum for XinFin XDC Network

Lokesh
Lokesh

Posted on

[WIP] Hardhat: Upgradeable Proxy support for XDC

Unable to setup upgradeable proxy contract using Hardhat features. Setup is working fine with other evm compatible blockchain.

Can we look into this?

Image description

How to replicate this issue?

const { ethers, upgrades } = require("hardhat");

async function main() {
  //   const gas = await ethers.provider.getGasPrice();
  const CLCStakePool = await ethers.getContractFactory("CLCStakePool");
  console.log("Deploying stakePool...");
  const v1contract = await upgrades.deployProxy(CLCStakePool,[]);
  await v1contract.waitForDeployment();
  console.log("Contract deployed to:", await v1contract.getAddress());
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
Enter fullscreen mode Exit fullscreen mode

use this deployment script, replace the contract with your own contract.

Expected results : it should deploy the contract fine and provide the contract address

Actual Results : Erroring out with "ProviderError: too many arguments, want at most 1"

Discussion (7)

Collapse
logeswaran profile image
Lokesh Author

please try this : github.com/GoPlugin/hardhat-proxy

please check the README

Collapse
gzliudan profile image
Daniel Liu

Would you please give a demo project on GitHub for test and troubleshooting?

Collapse
logeswaran profile image
Lokesh Author

please try this : github.com/GoPlugin/hardhat-proxy

please check the README

Collapse
gzliudan profile image
Daniel Liu • Edited on

I also encountered this error. I will look into it later.

Deploy TestTokenV1 ...
ProviderError: too many arguments, want at most 1
    at HttpProvider.request (/home/me/erc20-hardhat/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at HardhatEthersProvider.estimateGas (/home/me/erc20-hardhat/node_modules/@nomicfoundation/hardhat-ethers/src/internal/hardhat-ethers-provider.ts:237:27)
    at /home/me/erc20-hardhat/node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:235:35
    at async Promise.all (index 0)
    at HardhatEthersSigner._sendUncheckedTransaction (/home/me/erc20-hardhat/node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:256:7)
    at HardhatEthersSigner.sendTransaction (/home/me/erc20-hardhat/node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:125:18)
    at ContractFactory.deploy (/home/me/erc20-hardhat/node_modules/ethers/src.ts/contract/factory.ts:111:24)
    at ethersDeploy (/home/me/erc20-hardhat/node_modules/@openzeppelin/hardhat-upgrades/src/utils/deploy.ts:32:28)
    at deploy (/home/me/erc20-hardhat/node_modules/@openzeppelin/hardhat-upgrades/src/utils/deploy.ts:24:12)
Enter fullscreen mode Exit fullscreen mode
Collapse
logeswaran profile image
Lokesh Author

Hi,

do we have any updates here, please

Collapse
gzliudan profile image
Daniel Liu • Edited on

Would you please open an issue on github.com/XinFinOrg/XDPoSChain, so we can track your problem.

Thread Thread
logeswaran profile image
Lokesh Author