Skip to content

Latest commit

 

History

History
 
 

timelock

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

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
├── project
│   ├── contracts
│   │   └── timelock-contract
│   │       ├── src/main.sw
│   │       └── tests/harness.rs
│   ├── README.md
│   └── SPECIFICATION.md
├── ui
│   ├── README.md
│   └── SPECIFICATION.md
└── README.md

Running the project

User interface

TODO: The user interface does not currently exist therefore its README.md and SPECIFICATION.md are empty.

Project

In order to run the subsequent commands change into the following directory /path/to/timelock/project/<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