hello guys. i need to communicate with SC without abi. I see the name of the first method, for example contribute() (in etherscan), so i did interface with method "function contribute() external payable {}" so i can call it throught web3py and everything works fine. but i dont see the name of the second method, only 0x663082ce, i know there are no any params too, i just dont know name to add in my interface. is there any way to decode this? thanks in advance

Mar 29, 2022, 1:20 PM
Mar 29, 2022, 1:23 PM
Maybe need add event ?
or verify your contract ?
Mar 29, 2022, 1:26 PM
What you see is the signature of the function, should be enough if you also know what parameters it needs
Mar 29, 2022, 1:26 PM
i dont have abi, i dont have access to the source code. with contribute() everything works fine. but i suppose the second method is something like sell() or withdraw(), i only know that it doesnt take any params too
is it possible to call method just by signature?
Mar 29, 2022, 1:27 PM
Sure, you can use .call() along with abi.encodeWithSelector()
Or abi.encodeWithSignature() if that suits your needs
Mar 29, 2022, 1:30 PM
https://www.4byte.directory/
Try this resource 🧐
Mar 29, 2022, 1:31 PM
i mean from the script like web3py. of course i can do it through contract, but i need to do this from script))
Mar 29, 2022, 1:31 PM
Yeah you can do the same in script, many web3 libs have the same types of helpers
Mar 29, 2022, 1:31 PM
If you can do it via contract you can do it via web3py too
Mar 29, 2022, 1:32 PM
hmm, sounds fine, i will research more about that, just still cant find solution 🙂
thanks for the source
Mar 29, 2022, 1:32 PM
Lazy solution you write a smart contract that does it and exposes an easier interface for you to query it via web3
If you don't want to search for how to do that in web3
Mar 29, 2022, 1:33 PM
hmm, i will try to figure out, tyvm 🙂
Mar 29, 2022, 1:34 PM
Yw
Mar 29, 2022, 1:34 PM
I.e. _decimals for a function param
Mar 29, 2022, 2:08 PM
sir can i dm you ? i need urgently my liquidity cant remove
Mar 29, 2022, 2:41 PM
Sure
Mar 29, 2022, 2:48 PM
thx
Mar 29, 2022, 2:51 PM

© 2024 Draquery.com All rights reserved.