Skip to content

Latest commit

 

History

History

timelock

SwayApps Timelock Logo

Overview

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.

Project structure

The project consists of a smart contract.

timelock
├── timelock-contract
│   ├── src/main.sw
│   └── tests/harness.rs
├── README.md
└── SPECIFICATION.md

Running the project

User interface

TODO: The user interface does not currently exist.

Project

In order to run the subsequent commands change into the following directory /path/to/timelock/<here>.

Program compilation

forc build --locked

Running the tests

Before running the tests the programs must be compiled with the command above.

cargo test --locked