Good morning everyone, I'm new to the area with both programming and web3.
I am creating an interaction via api by Python to carry out transactions with a smart contract on the BSC network, but at that moment I got stuck because the ABI contract is not available. Does anyone know how I can continue and call the function?
Jun 1, 2023, 2:17 PM
Comments:
-1 that I have the function. (I got it from other transactions that are from the same method).
2- I got the source code of the contract.
3- I tried to compile the source code to generate an ABI contract and I couldn't
Someone give me a tip, I'm very new to the area, it's not even 15 days old and I'm stuck on this
-1 that I have the function. (I got it from other transactions that are from the same method).
2- I got the source code of the contract.
3- I tried to compile the source code to generate an ABI contract and I couldn't
Someone give me a tip, I'm very new to the area, it's not even 15 days old and I'm stuck on this
Jun 1, 2023, 2:18 PM
If you know the function name and parameters, you can create the abi yourself, or use a similar Abi from another contract
Like to interact with erc20-like tokens, you can just use the base erc20 Abi on every token and it will work regardless of the contract code
On ethers.js is better use getContractFactory when possible (on a dev workspace) so you can use tools like hardhat-tracer or get the exact row error on local nodes
Jun 1, 2023, 2:22 PM
I thought about creating it, but the problem I face is that I didn't know anything about .sol
My api is in web3.py
Jun 1, 2023, 2:37 PM
if you just need to interact with a contract from a backend/frontend, you don't need to know solidity
Jun 1, 2023, 2:37 PM
I have the function:
Function: bid(uint256 auctionIndex, uint256 amount)
Function: bid(uint256 auctionIndex, uint256 amount)
Jun 1, 2023, 2:38 PM
connect a web3 provider
create the abi
create the contract object
call the function
you're done
create the abi
create the contract object
call the function
you're done
you can use chatGpt to generate abi
Jun 1, 2023, 2:39 PM
The code I know and know how to do through python asks for an ABI contract so that it can follow the function.
ChatGPT does not generate ABI, I tried it yesterday.
I will try again now.
Jun 1, 2023, 2:41 PM
english
Jun 1, 2023, 2:41 PM
Jun 1, 2023, 2:41 PM
Thank you very much, I will try now.
Jun 1, 2023, 2:43 PM
you can use this to understand and "tune" chatGpt
https://flux.paradigm.xyz/
it's really useful and efficent for small tasks, like generate an abi for example
https://flux.paradigm.xyz/
it's really useful and efficent for small tasks, like generate an abi for example
or this ^
Jun 1, 2023, 2:44 PM
thank you very much.
Did not work, I can call you in private?
Jun 1, 2023, 3:37 PM
What do you mean you couldn't compile ?
Manually is a pain
Jun 1, 2023, 7:32 PM
Compile to ABI
Jun 1, 2023, 7:55 PM
Are you using remix ?
Jun 1, 2023, 8:01 PM
Yes
Jun 1, 2023, 8:01 PM
Does it compile without errors ?
Or does it not compile at all ?
Jun 1, 2023, 8:02 PM
I am not able to compile there
Jun 1, 2023, 8:02 PM
What is the message you're getting ?
Discussed in dms :)
Jun 1, 2023, 8:28 PM