How to send a string to a smart contract using mxpy and shell script?

33 views Asked by At

How can I send a string in arguments to a smart contract using a shell script and mxpy ? I’ve been trying to use str:“My string to send” as an argument to mxpy call but it doesn’t work I’ve also been trying other technics.

I can’t find the way to do it, can anyone help me please?

1

There are 1 answers

0
Quentin On

str: should be inside the quotes

Therefore str:“My string to send” is wrong, "str:My string to send" is the correct way to do that

Example:

mxpy --verbose contract call <contract's address> --recall-nonce \
--pem=<pem's path> \
--gas-limit=<your gas limit> \
--proxy=<proxy's url> \
--chain=<chain's id> \
--function="MyFunction" \
--arguments "str:My string to send" \
--send --wait-result