In Solidity, function arguments are usually byte, uint, string types. So when calling contract functions through web3 object, do we need to convert arguments into proper types? Or there are implicit type conversions in web3? Can I just input string values in the javascript UI?
you don't need to convert the values into solidity types. web3js is a javascript API so it supports only the javascript type (details) but it doesn't matter. just use the string inputs from your form in var (javascript).
-
Thank you Badr! But what if the function argument is an array? Can I just pass it an array of strings in javascript? – Kangqi Li Nov 6 '16 at 19:01
-
-
I tried but it is weird. See my new question:ethereum.stackexchange.com/questions/10053/… – Kangqi Li Nov 16 '16 at 5:29