okx / exchain

⛓️ EVM & Wasm $ IBC-compatible, OKTC is a L1 blockchain network built on top of Cosmos SDK that aims for optimal interoperability and performance ✨
https://www.okx.com/oktc
Other
565 stars 181 forks source link

Hardhat transaction hash mismatch smart contract deployment #3209

Open alienc0der opened 1 year ago

alienc0der commented 1 year ago

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

giskook commented 1 year ago

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

alienc0der commented 1 year ago

OKTC testnet or the OKTC mainnet

OKTC testnet.

Smea1 commented 1 year ago

OKTC testnet or the OKTC mainnet

OKTC testnet.

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

alienc0der commented 1 year ago

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

Smea1 commented 1 year ago

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 commented 1 year ago

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

alienc0der commented 1 year ago

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:

alienc0der commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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