GuildController

Querying Guild and Type Weights

GuildController.guild_types(_addr: address) -> int128: view
Get guild type for address, as an integer
GuildController.guild_effective_weight(addr: address, time: uint256 = block.timestamp) -> uint256: view
Get Guild effective weight in the current epoch
  • addr: Guild address
  • time: Effective weight at the specified timestamp in the past or present
GuildController.guild_relative_weight(addr: address, time: uint256 = block.timestamp) -> uint256: view
Get Guild relative weight (not more than 1.0) normalized to 1e18 (e.g. 1.0 == 1e18). Inflation which will be received by it is inflation_rate * relative_weight / 1e18
  • addr: guild address
  • time: Relative weight at the specified timestamp in the past or present
GuildController.get_type_weight(type_id) -> uint256: view
Get current type weight
  • type_id: certain type id
GuildController.get_total_weight() -> uint256: view
The current total (type weighted) weight for all guild
GuildController.get_weights_sum_per_type(type_id: int128) -> uint256: view
The sum of all guild weights for type_id
GuildController.belong_to_guild(user_addr: address, guild_addr: address) -> bool: view
Check if a member in a guild

Querying User Vote

GuildController.vote_user_slope(user:address, guild: address) -> uint256: view
Information about user's current vote weight for guild
Returns the current slope, and veVRH locktime end.
GuildController.last_user_vote(user: address) -> uint256:view
Epoch time of laster vote by user for guild. A guild weight vote can only be modified once every 10days except vote for the current guild.

Create New Guild and Add Types

GuildController.add_type(_name: String[64], _symbol: String[32], gas_addr: address, weight: uint256 = 0)
Add a new guild type for burning a new kind of gas token
_name: Name of guild type
_symbol: symbol of GAS token
gas_addr: Address of the GAS token
weight: Weight of guild type
GuildController.create_guild(owner: address, guild_type: int128, rate: uint256) -> address
VRH DAO creates guild for users with guild type and guild rate. The owner must have 30000 veVRH at least. Guild can start mining at the start of next mining epoch.
  • owner: guild owner create for
  • guild_type: guild burning gas type
  • rate: guild rate charge from members, between 1% to a maximum of 20%.

Add, remove members and transfer guild ownership

GuildController.add_member(guild_address: address, user addr: address)
add a user to guild, can only be triggered by the current guild contract.
GuildController.remove_member(user_addr: address):
remove a member from guild, can only be triggered by the current guild contract.
GuildController.transfer_guild_ownership(new_owner: address):
Transfer ownership of Guild to new_owner
new_owner : Address to have ownership transferred to

Toggle Pause

GuildController.toggle_pause(guild_addr: address):
Toggle pause VRH inflation if any malicious behaviors from guild. Can only be triggered by DAO.

Change guild and GasEscrow template

GuildController.change_guild_contract(new_addr: address):
change guild contract template if necessary. Can only be triggered by DAO
GuildController.change_gas_escrow_contract(new_addr: address):
Change gas escrow template if necessary. Can only be triggered by DAO

Guild Voting

GuildController.refresh_guild_votes(user_addr: address, guild_addr: address):
One guild member will vote all veVRH weight to one guild when joining guild. Otherwise, remove all veVRH weight when leaving guild. It will take effect at the start of next epoch. refress_guild_votes will trigger from guild contract automatically when call user_checkpoint.
  • user_addr: Member address
  • guild_addr: Guild address