You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue #326 and the post reported that hardhat failed to deploy upgradeable contract to xdc blockchain. Below is the error message:
yarn run v1.22.19
$ hardhat run --network apothem scripts/deployTestTokenV1.js
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)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I found the user is using @openzeppelin/hardhat-upgrades v2 and ethers v6. The problem was gone after downgrade to @openzeppelin/hardhat-upgrades v1 and ethers v5. So the user closed this issue.
When use @openzeppelin/hardhat-upgrades v1 and ethers v5, rawArgs has no field "pending":
[
{
"from": "<address>",
"data": "<data>"
}
]
So it is that xdc blockchain can't handle the extra field "pending".
More tests
From the output of hardhat, it's estimateGas trigger the error. The following tests showed that the method eth_estimateGas does not support "pending", but the method eth_call support "pending".
We must enhance the method eth_estimateGas first, make it support "pending". Then we can continue to test the latest @openzeppelin/hardhat-upgrades and ethers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The problem
The issue #326 and the post reported that hardhat failed to deploy upgradeable contract to xdc blockchain. Below is the error message:
I found the user is using @openzeppelin/hardhat-upgrades v2 and ethers v6. The problem was gone after downgrade to @openzeppelin/hardhat-upgrades v1 and ethers v5. So the user closed this issue.
There are same issues on hardhat:
Further research
The error
too many arguments, want at most 1is reported by the functionparsePositionalArgumentsin file rpc/json.go:I debugged the input parameter
rawArgsin my development environment, found is error is triggered by an extra field "pending" inrawArgsarray:rawArgshas a field "pending":[ { "from": "<address>", "data": "<data>" }, "pending" ]rawArgshas no field "pending":[ { "from": "<address>", "data": "<data>" } ]So it is that xdc blockchain can't handle the extra field "pending".
More tests
From the output of hardhat, it's
estimateGastrigger the error. The following tests showed that the method eth_estimateGas does not support "pending", but the method eth_call support "pending".1. test eth_estimateGas with field "pending"
request:
respond with error:
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "too many arguments, want at most 1" } }2. test eth_estimateGas without field "pending"
request:
works fine:
{ "jsonrpc": "2.0", "id": 2, "result": "0x5fd5" }3. test eth_call with field "pending"
request:
works fine:
{ "jsonrpc": "2.0", "id": 3, "result": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f44656d6f20476f6c6420546f6b656e0000000000000000000000000000000000" }Conclusion
We must enhance the method eth_estimateGas first, make it support "pending". Then we can continue to test the latest @openzeppelin/hardhat-upgrades and ethers.
All reactions