0

Hello everybody hope all are good ? i need your help ..

Note i already know how we can monitoring mempool but i'm talking about function of smart contract...

As mempool with pending Tx, i want make the same but get pending function call from smart contract.

If i call function 'swap' or 'transfer' from smart contract how can i monitoring it ?

Sincerely Mike

1 Answer 1

0
const AddressOfToken = '0x123aBc';
const AddressOfToken_ABI = require('./"yourABIname".json')   
//File in same folder with ABI of CONTRACT

const Contract = new ethers.Contract(AddressOfToken ,AddressOfToken_ABI , 
provider);  
//Need add an endpoint to provider (ETH, BSC ...)


Contract.on("Transfer",async (from, to, value, event, ) => {

const info = {
from: from,
to: to,
value: ethers.utils.formatUnits(value, "DecimalfromContractHere"),
event: event,
hash : event.transactionHash,
: event.args[1],
};
})

This return pending Tx function from contract

Sincerely

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.