-
-
Save aenhsaihan/1d3d28c0bc152f6935a0d280a02067d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.5.16; | |
contract Escrow { | |
uint256 public anteAmount; | |
address game; | |
address player1; | |
address player2; | |
Escrow addr = Escrow(this); | |
address payable escrowWallet = address(uint160(address(addr))); | |
constructor(address _player1, address _player2, address _game) public { | |
player1 = _player1; | |
player2 = _player2; | |
game = _game; | |
} | |
function placeAnte(address player) public payable returns (bool) { | |
require(player == player1 || player == player2, "invalid player address."); | |
return true; | |
} | |
} | |
contract Game { | |
function challengeOpponent(address opponent) public { | |
Escrow escrow = new Escrow(msg.sender, opponent, address(this)); | |
escrow.placeAnte(msg.sender); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment