hey guys, does anyone know how to check the taxes of an erc20 token through a smart contract without using a local fork?
Dec 24, 2023, 11:57 PM
use eth_call method
you need a custom made contract to simulate buy and sells
Dec 25, 2023, 12:06 AM
what this personalized contract would need to have to be able to simulate buy/sell taxes
taxes are calculated directly in the _transfer function on most tokens, eth_call would not change the state of the chain, would this really work?
Dec 25, 2023, 1:35 AM
if you don't know how much fee the contract is cutting, the only way to test will be to actually use it
Dec 25, 2023, 8:37 AM
yes
eth_call is needed to make the call without changing the state
Dec 25, 2023, 9:07 AM
That's what I thought!😠I was hoping to find a way to check taxes without wasting gas on verification, but as you said to check I will be forced to use it.
exactly, but how would he check the tax change without changing the state?
Dec 25, 2023, 12:24 PM
this is why you need a contract
in 1 tx you have to buy and sell
you won't
just use eth_call
just use eth_call
Dec 25, 2023, 12:28 PM
Let me see if I understand, so I must make a contract that buys and sells, with this I can calculate the difference in tokens received and then find the taxes, I already understand that. But I must call the function of this contract using eth_call to avoid wasting gas, is that it?
Dec 25, 2023, 12:36 PM
exactly
Dec 25, 2023, 12:39 PM
Thank you all very much, I will try to do it this way.
I just came back to say that I managed it using eth_call, thank you friends and merry Christmas to everyone.
Dec 26, 2023, 2:00 AM