Hello, I want to send a message along the prize to a user, is there a way to concatenate a string with a value? I tried it like this but it doesnt work:
self.send().direct_egld(
&winner_address,
&prize,
(b"You won the lottery with ID: {}! Congratulations!", &lottery_id),
);
Any idea on how to add the "lottery_id" to the message?
We have a formatter that does this elegantly, although I never tried to format tx data. Should be something like sc_format("message {}", args) but I need to check
You are not really supposed to do string manipulations like these in a smart contract.
You would have to write a method that can convert the number to the right ascii bytes.
We have a formatter that does this elegantly, although I never tried to format tx data. Should be something like sc_format("message {}", args) but I need to check
You are not really supposed to do string manipulations like these in a smart contract. You would have to write a method that can convert the number to the right ascii bytes.