I want to know if this is possible:
Say you have a betting game contract and an erc20 token contract. Players create new games and send the erc20 token to the game contract. The winner of the game gets the total tokens involved in the game.
What I want to know is how to make the game contract send the erc20 tokens from itself to the winner of the game?
I tried to do this but I'm getting errors. Something about needing approvals/allowance etc. But if this is the case then the game contract would somehow have to automatically approve the erc20 token amounts per player and I don't know how to do this part. Any ideas guys?
Aug 18, 2023, 9:57 PM
You’re probably using transferFrom
Aug 18, 2023, 10:08 PM
after deposit to contract => token.transfer(to, amt)... run in the contract that has balances
to transfer to multiple users, run that transfer inside a loop
check the contracts uri viewer function and see if that id has uri set correctly, also need to be in correct formst
format
oh
seems alright
did you check the cid properly
where do you wanna display the image
just convert the cid to a viewable link and use that to display if it is a custom dapp
if that is a valid cid
Aug 18, 2023, 11:07 PM