Hi, help me please
Is this the json abi of the part of the smart contract under which the transaction takes place?
How to convert json abi to hex (is it hex?)?
Dec 16, 2021, 3:06 PM
That’s typically done for you by the library you’re using
Dec 16, 2021, 3:09 PM
Should I write in data the abi of the smart contract that is used to call the function?
Dec 16, 2021, 3:10 PM
What you typically do is you create an contravt object using the Abi - you then call functions on this object like in a normal programming language and pass them arguments and then the library will translate them into that hex string you pasted
You never really see the hex string or need to worry about it unless you are doing more complicated things
Dec 16, 2021, 3:13 PM
Yes, I did this using web3.js, now I'm learning window.ethereum
How I can create a contract object using window.ethereum?
How I can create a contract object using window.ethereum?
Dec 16, 2021, 3:16 PM
I’ve never heard of window.Ethereum, will need to take a look
Oooh it’s just the provider
Dec 16, 2021, 3:17 PM
its what you use to detect metamask web3
Dec 16, 2021, 3:17 PM
Yea it’s just injected
Haven’t done that in a few years so don’t know, I’m guessing you so what you need to do via web3.js as normal and then get the provider from window.Ethereum to send transactions
Dec 16, 2021, 3:18 PM
web3.js is no longer supported by metamask, this is my problem, I have all the code submitted to web3.js
Okay, I'll try to combine them somehow
But if someone knows how to do it, I would be gratefull
Or maybe someone can send a small code as an example of how to work through window.ethereum when interacting with a smart contract? For example just how approve can be done?
Dec 16, 2021, 3:24 PM
Still working on this decimal. Don't know how to do price. from uint
Dec 16, 2021, 4:18 PM