SHOOK / OFFICIAL PROTOCOLDocumentation
MAINNET EDITIONOpen SHOOK

ShookDailyLottery

Complete compiled interface, including inherited methods.

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

Constructor 1

nonpayableconstructor(address, address, address, address, uint64, uint64)
{
  "type": "constructor",
  "inputs": [
    {
      "name": "shook_",
      "type": "address",
      "internalType": "contract IERC20"
    },
    {
      "name": "coinflip_",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "gameFeeRouter_",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "coordinator_",
      "type": "address",
      "internalType": "contract ShookRandomnessCoordinator"
    },
    {
      "name": "randomnessSafetyDelay_",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "epochDuration_",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "nonpayable"
}

Functions 27

viewactivatedLobby(uint256)
{
  "type": "function",
  "name": "activatedLobby",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "activated",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
nonpayableactivateLobby(uint64, uint256, address, uint256, address, uint256)
{
  "type": "function",
  "name": "activateLobby",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "creator",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "creatorWeight",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "opponent",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "opponentWeight",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
nonpayablecancelLobby(uint64, uint256)
{
  "type": "function",
  "name": "cancelLobby",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
nonpayableclaim(uint64, address)
{
  "type": "function",
  "name": "claim",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "receiver",
      "type": "address",
      "internalType": "address"
    }
  ],
  "outputs": [
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
viewcoinflip()
{
  "type": "function",
  "name": "coinflip",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "address"
    }
  ],
  "stateMutability": "view"
}
viewcoordinator()
{
  "type": "function",
  "name": "coordinator",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract ShookRandomnessCoordinator"
    }
  ],
  "stateMutability": "view"
}
nonpayabledraw(uint64)
{
  "type": "function",
  "name": "draw",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "winner",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
nonpayabledrawWithSignature(uint64, bytes)
{
  "type": "function",
  "name": "drawWithSignature",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "signature",
      "type": "bytes",
      "internalType": "bytes"
    }
  ],
  "outputs": [
    {
      "name": "winner",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "nonpayable"
}
viewentryAt(uint64, uint256)
{
  "type": "function",
  "name": "entryAt",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "index",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "",
      "type": "tuple",
      "internalType": "struct ShookDailyLottery.Entry",
      "components": [
        {
          "name": "cumulativeWeight",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "player",
          "type": "address",
          "internalType": "address"
        }
      ]
    }
  ],
  "stateMutability": "view"
}
viewentryCount(uint64)
{
  "type": "function",
  "name": "entryCount",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "stateMutability": "view"
}
viewepochDuration()
{
  "type": "function",
  "name": "epochDuration",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
viewepochRolledOver(uint64)
{
  "type": "function",
  "name": "epochRolledOver",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "rolledOver",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
viewepochs(uint64)
{
  "type": "function",
  "name": "epochs",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "totalWeight",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "pot",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "activeLobbies",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "targetRound",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "winner",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "drawn",
      "type": "bool",
      "internalType": "bool"
    },
    {
      "name": "claimed",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
nonpayablefundAndResolve(uint64, uint256, uint256)
{
  "type": "function",
  "name": "fundAndResolve",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
viewgameFeeRouter()
{
  "type": "function",
  "name": "gameFeeRouter",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "address"
    }
  ],
  "stateMutability": "view"
}
viewlobbyEntrySource(uint256)
{
  "type": "function",
  "name": "lobbyEntrySource",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "source",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "stateMutability": "view"
}
viewlobbyOriginalEpoch(uint256)
{
  "type": "function",
  "name": "lobbyOriginalEpoch",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "epoch",
      "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"
}
viewrecordedSettledGame(bytes32)
{
  "type": "function",
  "name": "recordedSettledGame",
  "inputs": [
    {
      "name": "gameKey",
      "type": "bytes32",
      "internalType": "bytes32"
    }
  ],
  "outputs": [
    {
      "name": "recorded",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
nonpayablerecordSettledGame(uint64, address, uint256, address, address, uint256, uint256)
{
  "type": "function",
  "name": "recordSettledGame",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "game",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "gameId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "playerA",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "playerB",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "weightPerPlayer",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "amount",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
nonpayablerecordWager(uint64, uint256, address, uint256)
{
  "type": "function",
  "name": "recordWager",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "internalType": "address"
    },
    {
      "name": "weight",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
}
viewresolvedLobby(uint256)
{
  "type": "function",
  "name": "resolvedLobby",
  "inputs": [
    {
      "name": "lobbyId",
      "type": "uint256",
      "internalType": "uint256"
    }
  ],
  "outputs": [
    {
      "name": "resolved",
      "type": "bool",
      "internalType": "bool"
    }
  ],
  "stateMutability": "view"
}
viewrolledInto(uint64)
{
  "type": "function",
  "name": "rolledInto",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "destinationEpoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "view"
}
nonpayablerolloverExpiredEpoch(uint64)
{
  "type": "function",
  "name": "rolloverExpiredEpoch",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "outputs": [
    {
      "name": "destinationEpoch",
      "type": "uint64",
      "internalType": "uint64"
    }
  ],
  "stateMutability": "nonpayable"
}
viewshook()
{
  "type": "function",
  "name": "shook",
  "inputs": [],
  "outputs": [
    {
      "name": "",
      "type": "address",
      "internalType": "contract IERC20"
    }
  ],
  "stateMutability": "view"
}

Events 10

eventLotteryClaimed(uint64, address, uint256)
{
  "type": "event",
  "name": "LotteryClaimed",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "winner",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLotteryDrawn(uint64, address, uint256, uint64)
{
  "type": "event",
  "name": "LotteryDrawn",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "winner",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "targetRound",
      "type": "uint64",
      "indexed": false,
      "internalType": "uint64"
    }
  ],
  "anonymous": false
}
eventLotteryFunded(uint64, uint256, uint256)
{
  "type": "event",
  "name": "LotteryFunded",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLotteryLobbyActivated(uint64, uint256)
{
  "type": "event",
  "name": "LotteryLobbyActivated",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLotteryLobbyCancelled(uint64, uint256)
{
  "type": "event",
  "name": "LotteryLobbyCancelled",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLotteryLobbyResolved(uint64, uint256, uint64)
{
  "type": "event",
  "name": "LotteryLobbyResolved",
  "inputs": [
    {
      "name": "originalEpoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "assignedEpoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    }
  ],
  "anonymous": false
}
eventLotteryLobbyWeightRecorded(uint64, uint256, address, uint256)
{
  "type": "event",
  "name": "LotteryLobbyWeightRecorded",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "lobbyId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "weight",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventLotteryRolledOver(uint64, uint64, uint256, uint256, uint64)
{
  "type": "event",
  "name": "LotteryRolledOver",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "destinationEpoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "weight",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "targetRound",
      "type": "uint64",
      "indexed": false,
      "internalType": "uint64"
    }
  ],
  "anonymous": false
}
eventLotteryWeightRecorded(uint64, uint256, address, uint256)
{
  "type": "event",
  "name": "LotteryWeightRecorded",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "gameId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "player",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "weight",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}
eventSettledGameRecorded(uint64, address, uint256, address, address, uint256, uint256)
{
  "type": "event",
  "name": "SettledGameRecorded",
  "inputs": [
    {
      "name": "epoch",
      "type": "uint64",
      "indexed": true,
      "internalType": "uint64"
    },
    {
      "name": "game",
      "type": "address",
      "indexed": true,
      "internalType": "address"
    },
    {
      "name": "gameId",
      "type": "uint256",
      "indexed": true,
      "internalType": "uint256"
    },
    {
      "name": "playerA",
      "type": "address",
      "indexed": false,
      "internalType": "address"
    },
    {
      "name": "playerB",
      "type": "address",
      "indexed": false,
      "internalType": "address"
    },
    {
      "name": "weightPerPlayer",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    },
    {
      "name": "amount",
      "type": "uint256",
      "indexed": false,
      "internalType": "uint256"
    }
  ],
  "anonymous": false
}

Errors 21

errorAlreadyClaimed()
{
  "type": "error",
  "name": "AlreadyClaimed",
  "inputs": []
}
errorAlreadyDrawn()
{
  "type": "error",
  "name": "AlreadyDrawn",
  "inputs": []
}
errorEpochAlreadyRolledOver()
{
  "type": "error",
  "name": "EpochAlreadyRolledOver",
  "inputs": []
}
errorEpochStillOpen()
{
  "type": "error",
  "name": "EpochStillOpen",
  "inputs": []
}
errorInvalidLobbyEpoch()
{
  "type": "error",
  "name": "InvalidLobbyEpoch",
  "inputs": []
}
errorLobbyAlreadyActivated()
{
  "type": "error",
  "name": "LobbyAlreadyActivated",
  "inputs": []
}
errorLobbyAlreadyResolved()
{
  "type": "error",
  "name": "LobbyAlreadyResolved",
  "inputs": []
}
errorLobbyNotActivated()
{
  "type": "error",
  "name": "LobbyNotActivated",
  "inputs": []
}
errorNoEntries()
{
  "type": "error",
  "name": "NoEntries",
  "inputs": []
}
errorNotWinner()
{
  "type": "error",
  "name": "NotWinner",
  "inputs": []
}
errorOnlyCoinflip()
{
  "type": "error",
  "name": "OnlyCoinflip",
  "inputs": []
}
errorOnlyGameFeeRouter()
{
  "type": "error",
  "name": "OnlyGameFeeRouter",
  "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"
    }
  ]
}
errorSettledGameAlreadyRecorded()
{
  "type": "error",
  "name": "SettledGameAlreadyRecorded",
  "inputs": []
}
errorZeroAddress()
{
  "type": "error",
  "name": "ZeroAddress",
  "inputs": []
}
errorZeroAmount()
{
  "type": "error",
  "name": "ZeroAmount",
  "inputs": []
}

Source and provenance

Imported source files 15

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

Source fingerprint: 3bd3d956c6f288981dec6d4461fdc153ced375792324983f9c7e5bdd67656a31. Download manifest.