Staking
Last updated
Last updated
For on-chain games, players will be asked to use their wallet to sign a Stake to enter a match. The Stake object is an EIP712 record (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) that guarantees later payment of entry fee.
In this example, the payload you are being asked to sign includes all the typical EIP712 security features (these are discussed in more detail in Networking + Security), as well as an amount and fee. These are in Wei.
Because this payload is an EIP712 payload, Metamask and other wallets are able to type check and present a nice UI.
Once signed, the Hangman server hangs onto this signature. On completion of the match by both parties, the Hangman server submits both player's signed stakes, as well as the winner to the Game Wallet contract. The contract itself is responsible for verifying the stakes and awarding players.
On Base Mainnet, the contract resides here.