Git Source
bytes1 public constant ROCK = bytes1(uint8(Hand.Rock));
bytes1 public constant PAPER = bytes1(uint8(Hand.Paper));
bytes1 public constant SCISSORS = bytes1(uint8(Hand.Scissors));
mapping(address => RPSPlay[]) public games;
function getUserGameLength(address _user) public view returns (uint256);
function play(address _player, uint256 _amount, bytes1[] memory _hands) public virtual;
function play(address _player, uint256 _amount, bytes32 _hands, uint8 _streak) public virtual;
function handsToBytes32(bytes1[] memory _hands) public pure returns (bytes32 result);
function toRPS(uint256 _amount, bytes32 _hands, uint8 _streak) public view returns (RPSPlay memory result);
function calcMultiplier(uint8 _len, bytes32 _player, bytes32 _dealer) internal pure returns (uint256 multiplier);
function rule(bytes1 _player, bytes1 _dealer) internal pure returns (uint8);
function verify(RPSPlay memory data) internal view returns (uint8 code);
function getDealerHash(RPSPlay memory data) public view returns (bytes32);
function claimReward(address owner) public returns (uint256 prize);
event GamePlayed(address indexed player, uint256 indexed countPlay, uint256 targetBlock, uint256 timestamp);
event Claimed(address indexed player, uint256 reward);
struct RPSPlay {
address player;
uint256 timestamp;
uint256 targetBlock;
uint256 bet;
bytes32 hands;
uint8 streak;
}
enum Hand {
Rock,
Paper,
Scissors
}