Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

/timelock 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

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.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/timelock.BlocksRemaining(,)"

Result