Replies: 2 comments 6 replies
-
This is unlikely something I would add to ethers, but is certainly something you could consider adding an ancillary package for. You could implement your changes as a sub-class of I have tried in the past to add functionality to aid alternate and fringe chains, but unfortunately the code's cleanliness suffers and providing support and maintaining the feature becomes quite time consuming. It also tends to add bloat, including code that only a small subsection of users require, but that all users must incur the download costs and code complexity costs for. Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
(moving to discussions) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello ethers.js developers, we are from the okexchain team, we are looking forward to ethers.js to support okexchain. If you agree to cooperate with okexchain, you can check the detailed requirements below.
The problem we are encountering now is this: When a user uses ethers.js to send a transaction to OKExChain, an error occurs. The reason for the error is that the transaction hash returned by the OKExChain is inconsistent with the hash that ethers.js expects.
OKExChain is a public chain based on CosmosSDK and compatible with Ethereum. We basically implement all the functionalities and interfaces of Ethereum, so users can deploy and interact with smart contracts on OKExChain like in Ethereum. However, the way OKExChain calculates transaction hash is different from the way Ethereum does, so the same transaction will get different transaction hashes on OKExChain and Ethereum. We guess that the error mentioned above is because ethers.js uses the same transaction hash calculation method as Ethereum does.
Users will not get into this error when using Truffle to send transactions to OKExChain, perhaps because Truffle does not calculate the transaction hash locally and compare it with the return value of the OKExCHain. So in order to allow users to better use ethers.js in the OKExChain ecosystem, some adaptation work would be preferred? We have three suggestionsyou’re your reference:
When sending a transaction, do not perform local hash calculation, but directly use the transaction hash returned by the OKEexChain.
Add the method to calculate the transaction hash in the way OKExChain does, and allow users to choose which way of transaction hash calculation they want.
When sending a transaction, determine the chain id passed by the user is the one used by OKExChain's (65, 66). If it is the case, the transaction hash returned by the interface will be used directly.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions