does anyone knows how to simulate sell/buy/transfer using contract abi and bytecode for tokens? for example, checking taxes and dead blocks from block x - block x
Jul 22, 2023, 9:43 AM
Hardhat, foundry... you can use pretty much any toolsuite to do that
Jul 22, 2023, 10:40 AM
May I get the knowledge from you of how to achieve that?
The logic and structure
Jul 22, 2023, 11:43 AM
Are you familiar with using any of these toolsuites?
Jul 22, 2023, 11:44 AM
Sort of I guess? is it like using hard hat to deploy the contract using Abi and byte code? And then simulate?
Do I need environment like truffle or ganche?
Jul 22, 2023, 11:46 AM
Yeah that's it. You can write a test script which does all the things you need
Run that on a mainnet fork and you're good to go
Jul 22, 2023, 11:54 AM
But 1 thing I’m curious is, how do I read which are the functions/methods that do this and that? For example, identifying which method will open trading (let’s say if people want to snipe)
Because different contracts has different methods and functions
Jul 22, 2023, 11:57 AM
That's pretty much impossible to know without having the actual contract code. Abi only returns function selectors. I can name my function superSafeTokenFunction and use that to rugpull
Jul 22, 2023, 11:59 AM
What if let’s say, before moving on to do the simulation, I can get the verified source code , not only the Abi
Will it be possible then?
Jul 22, 2023, 12:00 PM
Without manual checking: hard but not impossible. You can do some static analysis and figure out which function do what
Jul 22, 2023, 12:02 PM
So meaning to say like , identify certain keywords and certain basic functions to determine which methods does what?
Jul 22, 2023, 12:05 PM
Have a list of commonly used function sigs and check if that's present, check for setters which changes something that directly affects the transfer function...
Jul 22, 2023, 12:07 PM
Gosh it’s gna be a hard one, thank you so much for your help @grimreaper619 you helped me understand a lot today! Can I seek you for help again if I need?
Jul 22, 2023, 12:09 PM
No worries. You can simply ask here and someone will help you out. Goodluck with your project ;)
Jul 22, 2023, 12:10 PM
Thank you! Actually I realise I can make use of AI to actually detect methods functionality
Jul 22, 2023, 12:11 PM
Also this can be useful
https://www.4byte.directory/
https://www.4byte.directory/
https://github.com/openchainxyz/abi-guesser
Jul 22, 2023, 1:10 PM
i think it is outdated
if I am not wrong the current version migrated here
https://openchain.xyz/signatures
https://openchain.xyz/signatures
Jul 22, 2023, 1:18 PM
What is this mate!
Jul 22, 2023, 3:23 PM
it's a package that decode calldata to it's real type
Jul 22, 2023, 3:28 PM
hey sister... can you unblock me on the lunatics token channel? the old team banned me 🙈
Jul 22, 2023, 3:40 PM
Can you give me an example?
Jul 22, 2023, 3:51 PM