A modern variation of credit card roulette using smart contracts, the AAVE protocol, and Chainlink oracles to generate provably fair results.
Players who share an expense may choose to place a wager on a single player covering the entire bill. To initiate this, one player begins the game by specifying the number of players, the wager amount, and the recipient address for the payment.
Then players delegate credit to the game contract, and a Chainlink request is initiated. The outcome of this request determines which player will be responsible for sending the full payment amount to the designated address.
The game contract then borrows GHO against the responsible party's AAVE collateral on the Ethereum Sepolia testnet and transfers the funds. Players also have the option to use CCIP for transferring the settlement to Arbitrum Sepolia.
I created this game using vanilla web technologies: HTML, CSS, PHP, and JavaScript, in addition to the Web3JS plugin. For the backend development of the game, I utilized the Ethereum Sepolia Testnet.
I also integrated with the AAVE protocol using the depositETH() function from the wETH gateway contract to add collateral for a player when necessary. Additionally, the game requires players to delegate credit to the game contract so that they can mint GHO tokens against a the losing player's collateral.
Lastly, I used Chainlink VRF to ensure provably fair outcomes for each game. And I integrated CCIP to transfer GHO from Ethereum Sepolia to Arbitrum Sepolia when a player chooses to do so.