CookieStation

Git Source

Inherits: CookieVendor, Ownable, Pausable, Multicall

State Variables

games

mapping(uint256 => GameMeta) internal games;

gameCount

uint256 gameCount;

rewards

mapping(address => uint256) public rewards;

Functions

constructor

constructor() payable Ownable(msg.sender);

pause

function pause() public onlyOwner;

unpause

function unpause() public onlyOwner;

onlyStatus

modifier onlyStatus(Status _status);

setGame

function setGame(uint256 _gameId, address _game, uint256 _minAmount, uint256 _maxAmount) external onlyOwner;

getGameMeta

function getGameMeta(uint256 _gameId) external view returns (GameMeta memory);

claim

function claim() external onlyStatus(Status.SHOULD_WITHDRAW);

withdraw

function withdraw() public;

playRandom

function playRandom(uint256 _gameId, uint256 _amount, uint256 _length, bytes32 _seed)
    external
    onlyStatus(Status.NEED_GAME);

charge

function charge(uint256 _amount) private onlyStatus(Status.NEED_READY);

Structs

GameMeta

struct GameMeta {
    address logic;
    uint256 minAmount;
    uint256 maxAmount;
}

Enums

Status

enum Status {
    NEED_READY,
    NEED_GAME,
    SHOULD_WITHDRAW
}