Skip to main content

VotingEscrow & VeToken (BARK)

  • VotingEscrow: 0x19cDA4B6EEb4AB71033Ef926c9ee096Af25E8bdd
  • VeToken (BARK): 0x776347AF16E01BE5CdC028b556bE029C156024a2

VeToken is the BARK ERC-20. VotingEscrow locks BARK into a non-fungible veNFT whose voting power decays linearly to zero at the lock's expiry. Source: bark_contracts/ve3/contracts/VotingEscrow.sol (byte-identical to THENA upstream).

Locking

FunctionDescription
create_lock(uint256 _value, uint256 _lock_duration) → uint256 tokenIdLock _value BARK for _lock_duration seconds; mints a veNFT.
create_lock_for(uint256 _value, uint256 _lock_duration, address _to) → uint256Lock on behalf of another address.
increase_amount(uint256 _tokenId, uint256 _value)Add BARK to an existing lock.
increase_unlock_time(uint256 _tokenId, uint256 _lock_duration)Extend the lock duration.
withdraw(uint256 _tokenId)Withdraw BARK after the lock has expired.
merge(uint256 _from, uint256 _to)Merge two veNFTs.

Maximum lock is two years; longer locks confer proportionally more voting power.

Reading voting power

FunctionDescription
balanceOfNFT(uint256 _tokenId) → uint256Current voting power of a veNFT.
balanceOfNFTAt(uint256 _tokenId, uint256 _t) → uint256Voting power at timestamp _t.
totalSupply() → uint256Aggregate voting power across all veNFTs.
locked(uint256 _tokenId) → (int128 amount, uint256 end)Locked BARK amount and unlock time.
ownerOf(uint256 _tokenId) → addressveNFT owner (standard ERC-721).

Key events

  • Deposit(address indexed provider, uint256 tokenId, uint256 value, uint256 indexed locktime, uint8 deposit_type, uint256 ts)
  • Withdraw(address indexed provider, uint256 tokenId, uint256 value, uint256 ts)
  • Transfer(address indexed from, address indexed to, uint256 indexed tokenId)

The Deposit event carries the new tokenId — read it from the receipt after create_lock.

On this page
Jump to a section