Guys, an interesting question - is there any way to transfer data, from JSON for example, to a smart contract directly (maybe using JS)?

Jul 7, 2023, 11:28 AM
you can load up the .json in your javascript environment and parse it as you wish, then you send it through functions to the contract.
I do similar things with migrations, those are .csv files parsed and cleaned by another script, an hardhat script does the checks & migration fully auto
Jul 7, 2023, 1:10 PM
Could you share any example? I will be very grateful
Jul 7, 2023, 1:14 PM
Jul 7, 2023, 1:29 PM
thank you
Jul 7, 2023, 1:29 PM
from there you can handle your json and your actions as you want
Jul 7, 2023, 1:32 PM
And one more question quickly - in idea I can parse values in a specific argument of a function? Figuratively, the function takes a string and a unit, and I take two values from JSON and throw one value into the string slot and the other into the unit slot. Is it possible to do this?
Jul 7, 2023, 1:37 PM
yup
Jul 7, 2023, 1:40 PM
Merci
Jul 7, 2023, 1:40 PM
Jul 7, 2023, 1:40 PM

© 2024 Draquery.com All rights reserved.