Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardhat transaction hash mismatch smart contract deployment #3209

Open
4 tasks
alienc0der opened this issue Jul 12, 2023 · 10 comments
Open
4 tasks

Hardhat transaction hash mismatch smart contract deployment #3209

alienc0der opened this issue Jul 12, 2023 · 10 comments

Comments

@alienc0der
Copy link

alienc0der commented Jul 12, 2023

Summary of Bug

1. Describe

Deploying Solidity smart contracts via Hardhat returns the following error:

Error: Transaction hash mismatch from Provider.sendTransaction. (expectedHash="0x46..80f8", returnedHash="0xc1..7d38", code=UNKNOWN_ERROR, version=providers/5.7.2)

2. Impact

Solidity smart contract deployment.

3. Recover

Deploying the same smart contract using Remix works.

Expected Result

Successfully deploy a Solidity smart contract using Hardhat.

Version

Git commit hash 39c86b1ba14a45591b93386d7c67462a76bcb92c

exchaind version v1.7.8

exchaincli version v1.7.8

Steps to Reproduce

Install hardhat version v2.16.1

Deploy Solidity smart contract

npx hardhat run scripts/deploy.js

Error: Transaction hash mismatch from Provider.sendTransaction. (expectedHash="0x46...", returnedHash="0xc1...", code=UNKNOWN_ERROR, version=providers/5.7.2)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@giskook
Copy link
Contributor

giskook commented Jul 13, 2023

Hi @alienc0der, Is this running on the OKTC testnet or the OKTC mainnet?

@alienc0der
Copy link
Author

OKTC testnet or the OKTC mainnet

OKTC testnet.

@Smea1
Copy link

Smea1 commented Jul 13, 2023

OKTC testnet or the OKTC mainnet

OKTC testnet.

hi,did you deploy with the hardhat default contract code?

@alienc0der
Copy link
Author

No. I've deployed a basic ERC-20 contract.

@Smea1
Copy link

Smea1 commented Jul 14, 2023

I tried hardhat2.16.1 and the official node (https://exchaintestrpc.okex.org) to successfully deploy the contract.
Can you provide your rpc node or change another account and try again?

@giskook
Copy link
Contributor

giskook commented Jul 14, 2023

Hi @alienc0der, we also deployed the same 39c86b1ba14a45591b93386d7c67462a76bcb92c comment's node and deploy the contracts, it works fine too.

@alienc0der
Copy link
Author

alienc0der commented Jul 14, 2023

I tried hardhat2.16.1 and the official node (https://exchaintestrpc.okex.org) to successfully deploy the contract.

I've upgraded hardhat to 2.16.1, but I still get the Error: Transaction hash mismatch from Provider.sendTransaction..

Can you provide your rpc node or change another account and try again?

I'm doing the deployment on a private testnet.

we also deployed the same 39c86b1ba14a45591b93386d7c67462a76bcb92c comment's node and deploy the contracts, it works fine too.

The actual deployment works, the smart contract code is deployed on the testnet (if I query the returned transaction hash, it appears in the RPC's response), but hardhat still returns the hash mismatch error:

  • Testnet genesis.json file
  • Testnet config.toml file

@alienc0der
Copy link
Author

alienc0der commented Jul 19, 2023

Hi @alienc0der, we also deployed the same 39c86b1ba14a45591b93386d7c67462a76bcb92c comment's node and deploy the contracts, it works fine too.

@giskook So you were able to deploy the smart contracts using hardhat without issues? I sent you some additional info in the comment above. I think this is an important issue because many Ethereum devs use hardhat and it can get confusing - the hash mismatch error is thrown, but the contract is successfully deployed.

@giskook
Copy link
Contributor

giskook commented Jul 20, 2023

Hi @alienc0der, we also deployed the same 39c86b1ba14a45591b93386d7c67462a76bcb92c comment's node and deploy the contracts, it works fine too.

@giskook So you were able to deploy the smart contracts using hardhat without issues? I sent you some additional info in the comment above. I think this is an important issue because many Ethereum devs use hardhat and it can get confusing - the hash mismatch error is thrown, but the contract is successfully deployed.

Hi @alienc0der , I will try your file to do the test.

@alienc0der
Copy link
Author

@giskook I found this thread on the OKT forum. This is exactly the issue I've encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants