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

Schedule

func Schedule(cur realm, action string, delayBlocks int) int

Schedule registers a new operation to run after delayBlocks blocks and returns its id. delayBlocks must be >= 0.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/timelock" -func "Schedule" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "topaz-1" -remote "https://rpc.topaz.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.topaz.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/timelock" -func "Schedule" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "topaz-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.topaz.testnets.gno.land" call.tx