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
├── timelock-contract
│ ├── src/main.sw
│ └── tests/harness.rs
├── README.md
└── SPECIFICATION.md
TODO: The user interface does not currently exist.
In order to run the subsequent commands change into the following directory /path/to/timelock/<here>
.
forc build --locked
Before running the tests the programs must be compiled with the command above.
cargo test --locked