I’d like to develop a small game where people could play with UST. Basically they send 5 UST to answer a question and if it’s the good answer, they can claim a reward (eg 10 UST).
However I do not find ressources to help me develop a smart contract which hold coins and redistributes them. I looked at Cosmwasm, at Terra Academy and onto some smart contract (eg terraswap or astoport) but did not really find what I was looking for.
I’m trying to understand the native coin example. If 309-316 never happens and you don’t retrieve the coin info into your contract, what would happen to the coins sent from the initial Msg?
You can try this on testnet.
Coins sent to a contract will sit in the contracts balance.
If the contract isn’t designed to handle it, they will just accumulate.
Is there a way to sent UST to my contract and in the same message, execute a function ?
I understood that info.funds are the funds of the sender’s wallet.
Since I have to send a message to send funds, and another one to call my smart contract, is there a standard way to check if I send the correct amount of UST ? Or can it be done in one message ?
Yeah, any executable message that you handle can carry coins. Check out the MessageInfo data you get in every message handler, you’ll find references to the sender and any funds in there.
Hello.
I am developing smart contract with terra-peep721 and want to send LUNA or UST or my cw20 token to other wallets.
I think I have to use Terra.js from the frontend.
I’d like to know how to send LUNA with the connected wallet with Terra.js.
And also smart contract too.