-
Notifications
You must be signed in to change notification settings - Fork 122
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
EVM: standard (?) field input
not allowed in eth transaction
#2048
Comments
Problem happens both with eth_call and eth_sendTransaction. Interessting that its not in the ETH docs. Then the question is why web3.js adds it to the call (with same value as I will try to investigate. |
May I know what you are trying to achieve with your script, and maybe share your code if you can.
|
I wanted to write a bot to interact with a SC deployed to DMC. SC is deployed and interaction via Remix works smoothly. but via web3 I get the mentioned error. will try to debug why web3 is adding the can't add .ts files. the code is
|
This test is using web3.py and functions without error. On web3.js I believe the code for declaring a new contract should look like const web3 = new Web3(process.env.PROVIDER);
const contract = new web3.eth.Contract(ABI, contractAddress); |
Its explicitly being set by web3.js here https://github.com/web3/web3.js/blob/f8a2533c2b09ce0a62f8414f2f6eed83ab78ca1f/packages/web3-eth/src/utils/format_transaction.ts#L43-L56 they assert that data and input is same, and make sure that both are set. (and same result if I create it with your code) |
And here, input is part of the rpc-api https://ethereum.github.io/execution-apis/api-documentation/ weirdly enough, there it doesn't include maybe this is an old definition and it was |
I often use the docs from alchemy for such cases. In the following link you will find everything about eth_call. https://docs.alchemy.com/reference/sdk-call I personally have never heard of "input". Until now I have always worked with "data". |
@kuegi the linked PR should allow you to use Tested with the following code import Web3 from "web3"
const web3 = new Web3(process.env.PROVIDER);
const contract = new web3.eth.Contract(ABI, contractAddress);
console.log(await contract.methods.retrieve().call()) |
@shohamc1 can confirm that eth_call works now, but interacting via transaction still fails on existing |
even a simple eth_call fails with
unknown field input, expected one of from, to, gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas, value, data, nonce, accessList, type
if the input field is provided. But this seems to be standard in eth. The generated tx by web3.js contains
data
andinput
with the same content.The text was updated successfully, but these errors were encountered: