Expand description

Permalock: Tribeca vote escrows with infinite lockup durations.

About

The Permalock program allows the creation of permalocks: vote escrows which are always locked to the maximum duration.

It works by allowing any user to refresh the lockup period of the vote escrow to the maximum period, ensuring that the owner of the Permalock can never unstake the tokens. Since the Tribeca DAO holds the program upgrade keys, a DAO can be certain that a permalock will never be unlocked, ever.

Documentation

Detailed documentation may be found on the Tribeca Documentation site.

Usage

Locking tokens

First, transfer tokens to the Permalock’s pending_tokens account. The pending_tokens account holds all tokens that are ready to be max-locked.

Next, refresh the Permalock with permalock::refresh_lock. This refreshes the Permalock’s escrow to max lock the tokens that have been deposited, plus refreshes the lock period of all existing Escrow tokens.

Address

Program addresses are the same on devnet, testnet, and mainnet-beta.

Contribution

Thank you for your interest in contributing to Tribeca Protocol! All contributions are welcome no matter how big or small. This includes (but is not limited to) filing issues, adding documentation, fixing bugs, creating examples, and implementing features.

When contributing, please make sure your code adheres to some basic coding guidlines:

  • Code must be formatted with the configured formatters (e.g. rustfmt and prettier).
  • Comment lines should be no longer than 80 characters and written with proper grammar and punctuation.

License

The Tribeca Permalock program is licensed under the Affero General Public License, version 3.0.

Modules

An Anchor generated module, providing a set of structs mirroring the structs deriving Accounts, where each field is a Pubkey. This is useful for specifying accounts for a client.

An Anchor generated module containing the program’s set of instructions, where each method handler in the #[program] mod is associated with a struct defining the input arguments to the method. These should be used directly, when one wants to serialize Anchor instruction data, for example, when speciying instructions on a client.

The permalock program.

Module representing the program.

Macros

Generates the signer seeds for a crate::Permalock.

Structs

A permanently locked locked_voter::Escrow.

Enums

Errors.

Statics

The static program ID

Functions

Confirms that a given pubkey is equivalent to the program ID

The Anchor codegen exposes a programming model where a user defines a set of methods inside of a #[program] module in a way similar to writing RPC request handlers. The macro then generates a bunch of code wrapping these user defined methods into something that can be executed on Solana.

Returns the program ID