The purpose of a timelock is to restrict the execution of a transaction to some window of time. The transaction usually involves a transfer of funds e.g. via an escrow, vesting schedule, deferred payment etc. however, it may also be used for valueless execution i.e. calls to a contract to perform computation.
The transaction arguments are hashed and stored in a queue awaiting a subsequent call for execution. A user may choose to execute the transaction during the window of time or cancel the transaction by removing it from the queue.
More information can be found in the specification.
The project consists of a smart contract.
timelock
├── project
│ ├── contracts
│ │ └── timelock-contract
│ │ ├── src/main.sw
│ │ └── tests/harness.rs
│ ├── README.md
│ └── SPECIFICATION.md
├── ui
│ ├── README.md
│ └── SPECIFICATION.md
└── README.md
TODO: The user interface does not currently exist therefore its README.md and SPECIFICATION.md are empty.
In order to run the subsequent commands change into the following directory /path/to/timelock/project/<here>
.
forc build --locked
Before running the tests the programs must be compiled with the command above.
cargo test --locked