# IBC Foreign Token Wager
Make sure you have all you need before proceeding:
- You understand the concepts of messages, Protobuf, and IBC.
- Have Go installed.
- The checkers blockchain codebase up to the can play query. You can get there by following the previous steps or checking out the relevant version (opens new window).
When you introduced a wager you made it possible for players to play a game and wager the base staking token of your blockchain application. What if your players want to play with other currencies? Your blockchain can represent a token from any other blockchain connected to your chain by using the Inter-Blockchain Communication Protocol (IBC).
You will be agnostic about the tokens that are represented and about who is taking care of the relayers. Your only concern is to enable the use of foreign tokens.
# New information
Instead of defaulting to "stake"
, let players decide what string represents their token. So you update:
The stored game:
The message to create a game:
To have Starport and Protobuf recompile both files, you can use:
To avoid surprises down the road, also update the MsgCreateGame
constructor:
You already know that you are going to emit this new information during the game creation. So add a new event key as a constant:
# Additional handling
You have prepared the ground by placing this token denomination into the relevant data structures. Now the proper values need to be inserted in the relevant locations:
In the helper function to create the
Coin
infull_game.go
:In the handler that instantiates a game:
Not to forget where it emits an event:
# Next up
In the next section you will learn how to conduct chain upgrades through migrations.