Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

timelock/v0 package

Overview

Package timelock is a simplified port of OpenZeppelin's TimelockController.

Operations are scheduled with a delay (measured in blocks). A scheduled operation becomes executable only once the chain height reaches the operation's ready height. Until then it can be cancelled by anyone (this simplified port omits role-based access control). Once executed or cancelled, an operation is terminal.

Solidity mapping:

  • block.number -> runtime.ChainHeight()
  • msg.sender -> unsafe.PreviousRealm().Address()
  • require(...) -> panic(...)
  • events -> chain.Emit(...)
  • mapping(id => op) -> avl.Tree keyed by zero-padded id

Function

BlocksRemaining

func BlocksRemaining(op *Operation, height int64) int64
Ask AI Claude ChatGPT

BlocksRemaining returns how many blocks remain before op is ready (0 if already ready or past).

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/timelock/v0.BlocksRemaining(,)"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/moul/x/daily/timelock/v0, for example a function call with arguments.