I am developing a tic tok toe game on the blockchain platform. The game is like this, a user connects to his Metamask wallet and creates a game, after creating the game, the contract address is provided to the game maker and he can send that address to his friends and the recipient can access that game. Connect and play using the address you received. I also put a feature that each user puts a certain amount of coins and after finishing the game, all the coins go to the winner. I want to lock the amount of coins he wants to put in the game when the user creates the game in his wallet and transfer the locked amount when the game is concluded.
How can I lock some coins in a user's wallet? I use Solidity and web3js
you can't lock the participation amount in the user wallet, whoever you can lock the amount in the smart contract address and once the game finished the amount goes to the winer from the contract address.