I have deployed contract(not mine), abi is not provided.
Input data used in transaction:
0xd1700e6c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Could someone help, how to call this function directly from web3? Or how to find out it's name. As I understand, when you call contract function you write: contract.methods.func().send()
. But how to call/send function if I only have methodId?
txid: https://polygonscan.com/tx/0x165f8d6e2b5a75a4daad8950444e2c31bba027da0b8c1b21ac760a954e69af88
You can create a raw transaction containing the function selector (as well as the function arguments) in the data
field, sign it, and send it to your node provider to broadcast it to the network.
// the sender private key needs to be added to web3 `accounts.wallet`
// see the blue "note" card in the docs for more details
await web3.eth.sendTransaction({
from: senderAddress,
to: contractAddress,
data: "0xd1700e6c..."
});
Docs: https://web3js.readthedocs.io/en/v1.7.0/web3-eth.html#sendtransaction