1

Hi I am trying to use Hardhat to deploy Ethereum smart contracts to my parachain with Frontier EVM inside. The Hardhat uses my own Typescript file to deploy contracts like this one: https://hardhat.org/hardhat-runner/docs/guides/deploying

Then I got this error: ProviderError: submit transaction to pool failed: Pool(InvalidTransaction(InvalidTransaction::Payment))

-----------== incrementer2 deployment script
owner: 0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b 
user1: 0x735113e044BFce4DebA5da7BfBc96A3e6A96F6Da
owner balance: 340282366920938463463.319096430768211455
user1 balance: 0.0
ProviderError: submit transaction to pool failed: Pool(InvalidTransaction(InvalidTransaction::Payment))
    at HttpProvider.request (...my_project/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
    at HDWalletProvider.request (...my_project/node_modules/hardhat/src/internal/core/providers/accounts.ts:182:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async EthersProviderWrapper.send (...my_project/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I am not sure what happened... My Hardhat can run Ethereum smart contract tests and deploy contracts to a local Ethereum network with no problem. The contract can be deployed to my parachain via Remix and MetaMask, too. but somehow Hardhat cannot directly deploy smart contracts...

1
  • DQ: But does the deployer account have enough balance? Jul 21, 2022 at 8:13

1 Answer 1

1

I solved it... Do not duplicate Hardhat plugin imports.

import { task, HardhatUserConfig } from "hardhat/config";
import { ethers } from "ethers";
import '@nomiclabs/hardhat-waffle'
import "@nomiclabs/hardhat-ethers";
import { config as dotenvConfig } from "dotenv";//to avoid conflict with const config: HardhatUserConfig = {}

Also wait for previous transaction to go through first:

const tx = await owner.sendTransaction({ 
    to: ERC1820_DEPLOYER, value: toWei(0.08) 
});
const receipt = await tx.wait().catch((err: any) => {
    console.log("Error 001:", err);
    return false;
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.