0

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

1 Answer 1

0

You can't. You'd have to take them using transferFrom() and put them in your contract, where they'd be locked until the game is concluded

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.