Skip to content

bio-xyz/vebio-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

veBIO - Vote-Escrowed BIO Token

Overview

veBIO is a vote-escrowed token implementation that enables BIO token holders to lock their tokens for a specified duration in exchange for voting power. The contract implements a time-weighted voting system where longer lock periods grant proportionally more voting power.

Key Features

  • Time-locked Staking: Users can lock BIO tokens for 1 to maxWeeks (configurable) to receive veBIO voting power
  • Linear Decay: Voting power decreases linearly over time unless auto-renewal is enabled
  • Auto-Renewal: Optional automatic lock renewal to maintain maximum voting power
  • Multiple Positions: Users can create up to 200 separate lock positions
  • Early Unlock: Admin-controlled emergency unlock mechanism for all positions
  • EIP-712 Support: Enables gasless voting through signed messages

Core Mechanics

  1. Voting Power Calculation:

    • Maximum voting power is achieved by locking for the full maxWeeks duration
    • Shorter lock periods receive proportionally less voting power
    • Formula: votingPower = (amount * lockWeeks / maxWeeks)
  2. Lock Management:

    • Create new locks with stake(amount, numWeeks, autoRenew)
    • Extend existing locks with extend(id, additionalWeeks)
    • Toggle auto-renewal with toggleAutoRenew(id)
    • Withdraw after lock expiry with withdraw(id)
  3. Governance Integration:

    • Inherits from OpenZeppelin's VotesUpgradeable for snapshot and delegation support
    • Compatible with Governor contracts for on-chain governance

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published