Submitting a contract transaction request
This method allows you to send a contract transaction request.
const spenderAddress = "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7";
const contractAddress = "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7";
const abi = [
{
inputs: [
{ internalType: "address", name: "spender", type: "address" },
{ internalType: "uint256", name: "amount", type: "uint256" },
],
name: "approve",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
];
const contract = new ethers.Contract(contractAddress, abi);
const DATA = contract.interface.encodeFunctionData("approve", [
spenderAddress,
"100000000000000000",
]);Usage in your script
Parameters
Parameter
Type
Required
Description
Last updated