How to properly encode a signedTransaction
See original GitHub issueDear Friends, Things are working properly when I load the Contract abi. I try to to achieve the same transaction without any abi. Her is my snippets :
const abi = [{ name: "setContenthash", type: "function", inputs: [{ type: "bytes32" }, { type: "bytes" }] }];
const iface = new window.ethers.utils.Interface(abi)
const data = iface.functions.setContenthash.encode([domainHash, encoded]);
const tx = await web3Provider.sendTransaction({ from: account, to: resolverAddress, data: data });
domainHash, encoded and Web3Provider are setup correctly no issue on that side however while running I got :
invalid hexlify value (arg=“value”, value={“from”:“0x2d8f8ded6bcefe6c0cbb45d9d48487fce9ca8b90”,“to”:“0x12299799a50340FB860D276805E78550cBaD3De3”,“value”:“0x304e6ade0efab67953e4a35dccf4d5fd4fbad55492477d71efd737f0aee514b113ee792c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000026e301017012203450ca71b83ff514dcff5047641bf1471caacdc35132b6f1165d318f9d7be5270000000000000000000000000000000000000000000000000000”}, version=4.0.39)
Any hints ?
By the way is there any proper place to talk about ethers.js ?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Heya!
A big difference between Web3.js and ethers.js is the distinction between a Provider and Signer. The
provider.sendTransaction
is similar to thesendRawTransaction
call. To send a transaction from an account, you need a Signer.This will send the transaction to be signed by the node.
Let me know if that helps, or if there are still problems. This is as good a place as any to ask questions, but you can also use our Gitter. 😃
Thanks Richards. It works great. Removing the from: resolved my issue.