VotingEscrow

Contract details

Querying balance and supply

VotingEscrow.balanceOf(addr: address, _t: uint256 = block.timestamp) -> uint256
Returns the current veVRH voting power of an address
  • addr: User wallet address
VotingEscrow.balanceOfAt(addr: address, _block: uint256) -> uint256
Measure the veVRH voting power at a historic block height
This function is taken from the MiniMe ERC20 implementation and is required for compatibility with Aragon.
  • addr: User wallet address
  • _block: Block to calculate the voting power at
VotingEscrow.totalSupply() -> uint256
Returns the current total voting power
VotingEscrow.totalSupplyAt(_block: uint256) -> uint256
Calculate the total voting power at a historic block height
  • _block: Block to calculate the total voting power at
VotingEscrow.locked(_user: address)
Get the locked VRH token amount
  • _user: Address to query

Vote-locks

VotingEscrow.create_lock(_value: uint256, _unlock_time: uint256)
Deposits VRH into the contract and creates a new lock. A new lock cannot be created if an existing lock already exists.
Prerequisite: The contract must be approved to transfer at least _value VRH
  • _value: The amount of VRH to deposit
  • _unlock_time: The epoch time when the tokens unlock, this value is rounded down to the nearest whole week. The minimum duration of a lock is 1 yrs. The maximum duration of a lock is 4 years.
VotingEscrow.create_lock_for(_value: uint256, _unlock_time: uint256)
Any user can deposit VRH into the contract and creates a new lock for others. Be aware that only for user can withdraw all VRH when the lock expired.
Prerequisite: The contract must be approved to transfer at least _value VRH
  • _value: The amount of VRH to deposit
  • _unlock_time: The epoch time when the tokens unlock, this value is rounded down to the nearest whole week. The minimum duration of a lock is 1 yrs. The maximum duration of a lock is 4 years.
VotingEscrow.increase_amount(_value: uint256)
Lock additional VRH into an existing lock.
  • _value : The amount of VRH to lock.
VotingEscrow.increase_unlock_time(_unlock_time: uint256)
Extend the unlock time on a lock that already exists.
  • unlock_time: New epoch time for unlocking. This value is rounded down to the nearest whole week. The maximum duration for a lock is four years.
VotingEscrow.withdraw()
Withdraw deposited VRH tokens when lock expired