trictrac 0 Posted January 23 Share Posted January 23 Does anyone know how to pass a date or string argument to a function that is part of a contract in rust or c? Answers much appreciated. Quote Link to post Share on other sites
Dorin Marian Iancu 1 Posted January 25 Share Posted January 25 I'm assuming you mean sending it as argument to an already deployed smart contract, using erdpy. There is no built-in "date" type in either C or Rust smart contracts. You will have to use unix timestamp as a u64. As for string, you'll have to hex-encode the bytes. There are plenty of tools online that do this, I personally use https://www.rapidtables.com/convert/number/ascii-to-hex.html Make sure you add a "0x" in front and use "None" as delimiter. 1 Quote Link to post Share on other sites
trictrac 0 Posted January 26 Author Share Posted January 26 That's indeed what I meant and this is exctly the answer I need. Many thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.