Purpose
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.
Domains → authority
Domain principals grant narrowly scoped authorities to accounts.
Purpose
Domain principals grant narrowly scoped authorities to accounts.
A grantor controls each authority directly or delegates that specific authority to VLVoting.
Basic workflow
Methods
These are the public and external methods declared directly by VLAuthority. Inherited token, ownership, and upgrade methods follow their respective standards.
initialize(address voting_)TransactionInitializes the deployed contract and its required dependencies.
registryName() returns (string memory)ReadReturns the human-readable name used for contract registration.
delegateAuthorityToVoting(bytes32 authority, bool delegated)TransactionExecutes the delegate authority to voting operation.
setAuthority(address grantor, address account, bytes32 authority, bool approved)TransactionUpdates the named protocol configuration value or permission.
hasAuthority(address grantor, address account, bytes32 authority) returns (bool)ReadExecutes the has authority operation.
authorities(address grantor, address account) returns (bytes32[] memory)ReadExecutes the authorities operation.
Node.js
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));Deployment
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.