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 (14)

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
Thread Thread
logeswaran profile image
Lokesh Author

Hi Daniel - I have tried this using ethers 5.7.0 version and added my comments in the git issue

github.com/XinFinOrg/XDPoSChain/is...

Thread Thread
gzliudan profile image
Daniel Liu

Please check my reply: github.com/XinFinOrg/XDPoSChain/is...

Thread Thread
logeswaran profile image
Lokesh Author

Working fine now!, thank you, this issue can be closed

Thread Thread
gzliudan profile image
Daniel Liu

This problem is fixed on testnet now. The patch will be applied on mainnet later.

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
Collapse
logeswaran profile image
Lokesh Author

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

please check the README

Collapse
mitali_blocksscan profile image
Mitali_BlocksScan

Hello @logeswaran
We hope that the above issue is resolved, if the issue still persists then please let us know about it so that the team can resolve it on priority. It will be grateful to get an update within 72 hours or else it will be considered resolved.
Thank You.

Collapse
logeswaran profile image
Lokesh Author

Surely, will test it shortly and revert please

Collapse
logeswaran profile image
Lokesh Author

It is not resolved yet @mitali_blocksscan . This is being tracked in issue in the github -> github.com/XinFinOrg/XDPoSChain/is...