kleros-interaction
kleros-interaction copied to clipboard
Historical Beacon RNG
Adapted from @kevincharm's RandaoAccessor
Specifications
https://docs.google.com/document/d/1hKlzk51z-ULnfSL4sQ7aCl70IQBxObtr1i8ZfsYl6MY/edit
Usage
- Court is in Staking phase. The bot calls
passPhase()
, which makes the RNG emit aRequest(_blockNumber)
event, - Court is now in Generating phase. The bot listens to the
Request
event and retrieves the requested block number, then retrieves the block header from RPC with the eth_getblockbynumber method, then RLP-encodes the header using getBlockWithRLP(), finally provides the header to the RNG by calling verifyRecent(), - The bot calls
passPhase()
, the Court is now in Drawing phase.