SHOOK / OFFICIAL PROTOCOLDocumentation
MAINNET EDITIONOpen SHOOK

ShookCoinflip

Complete compiled interface, including inherited methods.

Solidity 0.8.36+commit.8a079791 · Download ABI ↓ ·

Constructor 1

nonpayableconstructor(address, address, address, address, uint64, uint64, uint64, uint256, uint256, uint256)
{
  "type": "constructor",
  "inputs": [
    {
      "name": "shook_",
      "type": "address",
      "internalType": "contract IERC20"
    },
    {
      "name": "reserveVault_",
      "type": "address",
      "internalType": "contract IReserveVault"
    },
    {
      "name": "coordinator_",
      "type": "address",
      "internalType": "contract ShookRandomnessCoordinator"
    },
    {
      "name": "lottery_",
      "type": "address",
      "internalType": "contract IShookDailyLottery"
    },
    {
      "name": "lobbyDuration_",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "randomnessSafetyDelay_",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lotteryEpochDuration_",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "minimumWager_",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "maximumWager_",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "maximumPool_",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}

Functions 30

nonpayablebet(uint256, bool, uint256)
{
  "type": "function",
  "name": "bet",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "side",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
viewBPS()
{
  "type": "function",
  "name": "BPS",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
nonpayablecancelUnactivatedLobby(uint256)
{
  "type": "function",
  "name": "cancelUnactivatedLobby",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
nonpayablecancelUnavailableRandomness(uint256)
{
  "type": "function",
  "name": "cancelUnavailableRandomness",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
nonpayableclaimRefund(uint256, address)
{
  "type": "function",
  "name": "claimRefund",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "receiver",
      "type": "address",
      "internalType": "address"
    }
  ],
  "outputs": [
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
nonpayableclaimWinnings(uint256, address)
{
  "type": "function",
  "name": "claimWinnings",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "receiver",
      "type": "address",
      "internalType": "address"
    }
  ],
  "outputs": [
    {
      "name": "payout",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
viewcoordinator()
{
  "type": "function",
  "name": "coordinator",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract ShookRandomnessCoordinator"
    }
  ],
  "stateMutability": "view"
}
nonpayablecreateLobby(bytes32, bool, uint256)
{
  "type": "function",
  "name": "createLobby",
  "inputs": [
    {
      "name": "name",
      "type": "bytes32",
      "internalType": "bytes32"
    },
    {
      "name": "side",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
nonpayablefinalizeLobby(uint256)
{
  "type": "function",
  "name": "finalizeLobby",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "commitment",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "stateMutability": "nonpayable"
}
viewgetLobby(uint256)
{
  "type": "function",
  "name": "getLobby",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "",
      "type": "tuple",
      "internalType": "struct ShookCoinflip.Lobby",
      "components": [
        {
          "name": "name",
          "type": "bytes32",
          "internalType": "bytes32"
        },
        {
          "name": "creator",
          "type": "address",
          "internalType": "address"
        },
        {
          "name": "deadline",
          "type": "uint64",
          "internalType": "uint64"
        },
        {
          "name": "targetRound",
          "type": "uint64",
          "internalType": "uint64"
        },
        {
          "name": "lotteryEpoch",
          "type": "uint64",
          "internalType": "uint64"
        },
        {
          "name": "status",
          "type": "uint8",
          "internalType": "enum ShookCoinflip.Status"
        },
        {
          "name": "creatorSide",
          "type": "bool",
          "internalType": "bool"
        },
        {
          "name": "outcome",
          "type": "bool",
          "internalType": "bool"
        },
        {
          "name": "initialBet",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "headsTotal",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "tailsTotal",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "distributable",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "winningWeightClaimed",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "winnerPayouts",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "stateCommitment",
          "type": "bytes32",
          "internalType": "bytes32"
        }
      ]
    }
  ],
  "stateMutability": "view"
}
viewlobbies(uint256)
{
  "type": "function",
  "name": "lobbies",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "name",
      "type": "bytes32",
      "internalType": "bytes32"
    },
    {
      "name": "creator",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "deadline",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "targetRound",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lotteryEpoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "status",
      "type": "uint8",
      "internalType": "enum ShookCoinflip.Status"
    },
    {
      "name": "creatorSide",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "outcome",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "initialBet",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "headsTotal",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "tailsTotal",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "distributable",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "winningWeightClaimed",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "winnerPayouts",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "stateCommitment",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "stateMutability": "view"
}
viewlobbyDuration()
{
  "type": "function",
  "name": "lobbyDuration",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewLOTTERY_FEE_BPS()
{
  "type": "function",
  "name": "LOTTERY_FEE_BPS",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewlottery()
{
  "type": "function",
  "name": "lottery",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract IShookDailyLottery"
    }
  ],
  "stateMutability": "view"
}
viewlotteryEpochDuration()
{
  "type": "function",
  "name": "lotteryEpochDuration",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewmaximumPool()
{
  "type": "function",
  "name": "maximumPool",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewmaximumWager()
{
  "type": "function",
  "name": "maximumWager",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewminimumWager()
{
  "type": "function",
  "name": "minimumWager",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewnextLobbyId()
{
  "type": "function",
  "name": "nextLobbyId",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewpositions(uint256, address)
{
  "type": "function",
  "name": "positions",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "internalType": "address"
    }
  ],
  "outputs": [
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "side",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "claimed",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
viewRANDOMNESS_COHORT_DURATION()
{
  "type": "function",
  "name": "RANDOMNESS_COHORT_DURATION",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewRANDOMNESS_DOMAIN()
{
  "type": "function",
  "name": "RANDOMNESS_DOMAIN",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "stateMutability": "view"
}
viewRANDOMNESS_TIMEOUT()
{
  "type": "function",
  "name": "RANDOMNESS_TIMEOUT",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewrandomnessSafetyDelay()
{
  "type": "function",
  "name": "randomnessSafetyDelay",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewRESERVE_FEE_BPS()
{
  "type": "function",
  "name": "RESERVE_FEE_BPS",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewRESERVE_FEES_STREAM()
{
  "type": "function",
  "name": "RESERVE_FEES_STREAM",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "stateMutability": "view"
}
viewreserveVault()
{
  "type": "function",
  "name": "reserveVault",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract IReserveVault"
    }
  ],
  "stateMutability": "view"
}
nonpayablesettle(uint256)
{
  "type": "function",
  "name": "settle",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "outcome",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "nonpayable"
}
nonpayablesettleWithSignature(uint256, bytes)
{
  "type": "function",
  "name": "settleWithSignature",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "signature",
      "type": "bytes",
      "internalType": "bytes"
    }
  ],
  "outputs": [
    {
      "name": "outcome",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "nonpayable"
}
viewshook()
{
  "type": "function",
  "name": "shook",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract IERC20"
    }
  ],
  "stateMutability": "view"
}

Events 8

eventLobbyActivated(uint256, address)
{
  "type": "event",
  "name": "LobbyActivated",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "opponent",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    }
  ],
  "anonymous": false
}
eventLobbyCancelled(uint256)
{
  "type": "event",
  "name": "LobbyCancelled",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLobbyCreated(uint256, address, bytes32, bool, uint256, uint64, uint64, uint64)
{
  "type": "event",
  "name": "LobbyCreated",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "creator",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "name",
      "type": "bytes32",
      "indexed": false,
      "internalType": "bytes32"
    },
    {
      "name": "creatorSide",
      "type": "bool",
      "indexed": false,
      "internalType": "bool"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "deadline",
      "type": "uint64",
      "indexed": false,
      "internalType": "uint64"
    },
    {
      "name": "targetRound",
      "type": "uint64",
      "indexed": false,
      "internalType": "uint64"
    },
    {
      "name": "lotteryEpoch",
      "type": "uint64",
      "indexed": false,
      "internalType": "uint64"
    }
  ],
  "anonymous": false
}
eventLobbyFinalized(uint256, bytes32)
{
  "type": "event",
  "name": "LobbyFinalized",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "stateCommitment",
      "type": "bytes32",
      "indexed": false,
      "internalType": "bytes32"
    }
  ],
  "anonymous": false
}
eventLobbySettled(uint256, bool, uint256, uint256, uint256, bytes32)
{
  "type": "event",
  "name": "LobbySettled",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "outcome",
      "type": "bool",
      "indexed": false,
      "internalType": "bool"
    },
    {
      "name": "distributable",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "reserveFee",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "lotteryFee",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "seed",
      "type": "bytes32",
      "indexed": false,
      "internalType": "bytes32"
    }
  ],
  "anonymous": false
}
eventPayoutClaimed(uint256, address, uint256)
{
  "type": "event",
  "name": "PayoutClaimed",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventRefundClaimed(uint256, address, uint256)
{
  "type": "event",
  "name": "RefundClaimed",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventWagerPlaced(uint256, address, bool, uint256)
{
  "type": "event",
  "name": "WagerPlaced",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "side",
      "type": "bool",
      "indexed": false,
      "internalType": "bool"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}

Errors 22

errorBetBelowInitialBet()
{
  "type": "error",
  "name": "BetBelowInitialBet",
  "inputs": []
}
errorCreatorMustWaitForOpponent()
{
  "type": "error",
  "name": "CreatorMustWaitForOpponent",
  "inputs": []
}
errorInvalidConfiguration()
{
  "type": "error",
  "name": "InvalidConfiguration",
  "inputs": []
}
errorInvalidLobby()
{
  "type": "error",
  "name": "InvalidLobby",
  "inputs": []
}
errorInvalidLobbyName()
{
  "type": "error",
  "name": "InvalidLobbyName",
  "inputs": []
}
errorInvalidStatus()
{
  "type": "error",
  "name": "InvalidStatus",
  "inputs": []
}
errorInvalidWager()
{
  "type": "error",
  "name": "InvalidWager",
  "inputs": []
}
errorLobbyClosed()
{
  "type": "error",
  "name": "LobbyClosed",
  "inputs": []
}
errorLobbyStillOpen()
{
  "type": "error",
  "name": "LobbyStillOpen",
  "inputs": []
}
errorLosingPosition()
{
  "type": "error",
  "name": "LosingPosition",
  "inputs": []
}
errorNothingToClaim()
{
  "type": "error",
  "name": "NothingToClaim",
  "inputs": []
}
errorOpponentMustChooseOtherSide()
{
  "type": "error",
  "name": "OpponentMustChooseOtherSide",
  "inputs": []
}
errorPoolLimitExceeded()
{
  "type": "error",
  "name": "PoolLimitExceeded",
  "inputs": []
}
errorRandomnessAvailable()
{
  "type": "error",
  "name": "RandomnessAvailable",
  "inputs": []
}
errorRandomnessTimeoutOpen()
{
  "type": "error",
  "name": "RandomnessTimeoutOpen",
  "inputs": []
}
errorRandomnessWindowClosed()
{
  "type": "error",
  "name": "RandomnessWindowClosed",
  "inputs": []
}
errorReentrancyGuardReentrantCall()
{
  "type": "error",
  "name": "ReentrancyGuardReentrantCall",
  "inputs": []
}
errorSafeCastOverflowedUintDowncast(uint8, uint256)
{
  "type": "error",
  "name": "SafeCastOverflowedUintDowncast",
  "inputs": [
    {
      "name": "bits",
      "type": "uint8",
      "internalType": "uint8"
    },
    {
      "name": "value",
      "type": "uint256",
      "internalType": "uint256"
    }
  ]
}
errorSafeERC20FailedOperation(address)
{
  "type": "error",
  "name": "SafeERC20FailedOperation",
  "inputs": [
    {
      "name": "token",
      "type": "address",
      "internalType": "address"
    }
  ]
}
errorSideCannotChange()
{
  "type": "error",
  "name": "SideCannotChange",
  "inputs": []
}
errorZeroAddress()
{
  "type": "error",
  "name": "ZeroAddress",
  "inputs": []
}
errorZeroAmount()
{
  "type": "error",
  "name": "ZeroAmount",
  "inputs": []
}

Source and provenance

Imported source files 17

Supporting contracts, interfaces, and libraries imported by the sources above, including their dependencies.

Source fingerprint: 3bd3d956c6f288981dec6d4461fdc153ced375792324983f9c7e5bdd67656a31. Download manifest.