When I setup hardhat like this:
xdc_sandbox: {
url: 'https://rpc.apothem.network',
accounts: [***],
chainId: 51,
gasPrice: 'auto'
},
I got setup from https://docs.xdc.community/get-details/networks/apothem
and when I try to deploy hardhat deploy --network xdc_sandbox
I'm getting error about insufficient funds for intrinsic transaction cost
.
However, when I check wallet balance on https://explorer.apothem.network/ I see I have 1000 XDC:
There are other EVM networks configured and deployment script works for them.
I printed out data
console.log(`deploying on ${hre.network.name} (${await hre.getChainId()})`);
console.log(`balanceOf(${deployer.address}): (${await hre.ethers.provider.getBalance(deployer.address)})`);
and I got:
deploying on xdc_sandbox (51)
balanceOf(***): (0)
so for some reason hardhat does not see balance or RPC returns invalid state of the blockchain.
packages:
"@nomiclabs/hardhat-ethers": "~2.2.3",
"@typechain/ethers-v5": "~10.1.0",
"@typechain/hardhat": "~9.1.0",
"ethers": "~5.7.2",
"hardhat": "~2.14.0",
"hardhat-deploy": "~0.11.44",
"hardhat-deploy-ethers": "~0.3.0-beta.13",
Discussion (4)
Please use following RPC erpc.apothem.network to deploy a smart contract
Yes, please use 0x-prefix PRC node, such as:
erpc.apothem.network
worked at begin (I was able deploy contracts and send few "normal" transactions) and then it stoped working - I was not able to do any calls, request for balance returner 0 even if wallet has founds. I switched toearpc.apothem.network
and it started to work again.You can try
erpc.apothem.network
again. It's normal now.