hello, ive got a question thats been on my mind ... am trying to code a simple script to buy and sell tokens via Ethers or Web3 ... still not decided... and I was wondering how to query PancakeSwap or UniSwap as a simulated transaction to check if for example its a honeypot .. so if it is .. i dont buy the token. ... i searched a lot before coming here to ask .. but i couldnt find any reliable source... all i came across is that i might be able to fork mainnet on hardhat and do it? but i wanted something i can put in the code so it happens automatically ..
Dec 3, 2021, 1:13 PM
callstatic and a custom contract
Dec 3, 2021, 2:18 PM
Calling the swapethfortokens/tokensforeth functions on the router with staticcall in order to watch what the contract would do in the event we actually attempt a swap, yes?
Dec 3, 2021, 3:26 PM
Yes, but note the price can change between whej you do that and when you actually do a real swap on chain
Or take a course
Dec 3, 2021, 3:40 PM
cool, thanks. just read the docs and wanted to check if my understanding was correct
Dec 3, 2021, 4:01 PM