Domains → authority

VLAuthority

Domain principals grant narrowly scoped authorities to accounts.

What VLAuthority is for.

Domain principals grant narrowly scoped authorities to accounts.

A grantor controls each authority directly or delegates that specific authority to VLVoting.

How it fits together.

  1. Governance assigns a narrowly defined role to an account.
  2. Protocol contracts query that role when a protected operation is requested.
  3. Governance can revoke the role without redeploying consumers.

Declared public interface.

These are the public and external methods declared directly by VLAuthority. Inherited token, ownership, and upgrade methods follow their respective standards.

initialize(address voting_)Transaction

Initializes the deployed contract and its required dependencies.

registryName() returns (string memory)Read

Returns the human-readable name used for contract registration.

delegateAuthorityToVoting(bytes32 authority, bool delegated)Transaction

Executes the delegate authority to voting operation.

setAuthority(address grantor, address account, bytes32 authority, bool approved)Transaction

Updates the named protocol configuration value or permission.

hasAuthority(address grantor, address account, bytes32 authority) returns (bool)Read

Executes the has authority operation.

authorities(address grantor, address account) returns (bytes32[] memory)Read

Executes the authorities operation.

Connect with ethers v6.

import { Contract, JsonRpcProvider, Wallet, encodeBytes32String, parseUnits } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const signer = new Wallet(process.env.SIGNER_PRIVATE_KEY, provider);
const at = (address, abi, writable = false) =>
  new Contract(address, abi, writable ? signer : provider);

const authority = at(VL_AUTHORITY, [
  "function hasAuthority(address,address,bytes32) view returns (bool)"
]);
const role = id("Verifier:Transaction");
console.log(await authority.hasAuthority(devVowLabs, verifier, role));

Use the address for the chain you selected.

Read the deployment manifest or resolve the configured registry entry for the target network. Test on a local or test network before using a privileged signer. See the contract source and contract index for the full interface.