RioLRTAVSRegistry

Git Source

Inherits: IRioLRTAVSRegistry, OwnableUpgradeable, UUPSUpgradeable, RioLRTCore

State Variables

avsCount

The number of AVS in the registry (all-time).

uint128 public avsCount;

activeAVSCount

The number of active AVS in the registry.

uint128 public activeAVSCount;

_avs

Mapping of an AVS' ID to its name, slashing contract, and registry contract.

mapping(uint128 => AVS) private _avs;

_isActiveSlashingContract

Whether a slashing contract is active.

mapping(address => bool) private _isActiveSlashingContract;

_isActiveRegistryContract

Whether a registry contract is active.

mapping(address => bool) private _isActiveRegistryContract;

Functions

constructor

constructor(address issuer_) RioLRTCore(issuer_);

Parameters

NameTypeDescription

issuer_

address

The LRT issuer that's authorized to deploy this contract.

initialize

Initializes the contract.

function initialize(address initialOwner, address token_) external initializer;

Parameters

NameTypeDescription

initialOwner

address

The initial owner of the contract.

token_

address

The address of the liquid restaking token.

getAVS

Returns the AVS with the given ID.

function getAVS(uint128 avsId) external view returns (AVS memory);

Parameters

NameTypeDescription

avsId

uint128

The ID of the AVS.

isActiveSlashingContract

Whether the provived slashingContract is active.

function isActiveSlashingContract(address slashingContract) public view returns (bool);

Parameters

NameTypeDescription

slashingContract

address

The slashing contract address.

isActiveRegistryContract

Whether the provived registryContract is active.

function isActiveRegistryContract(address registryContract) public view returns (bool);

Parameters

NameTypeDescription

registryContract

address

The registry contract address.

addAVS

Adds a new AVS to the registry.

function addAVS(string calldata name, address slashingContract, address registryContract)
    external
    onlyOwner
    returns (uint128 avsId);

Parameters

NameTypeDescription

name

string

The name of the AVS.

slashingContract

address

The slashing contract address.

registryContract

address

The registry contract address.

activateAVS

Activates an AVS in the registry, allowing operators to opt-in to its slashing contract and call its registry contract.

function activateAVS(uint128 avsId) external onlyOwner;

Parameters

NameTypeDescription

avsId

uint128

The ID of the AVS.

deactivateAVS

Deactivates an AVS in the registry, preventing operators from opting-in to its slashing contract and calling its registry contract.

function deactivateAVS(uint128 avsId) external onlyOwner;

Parameters

NameTypeDescription

avsId

uint128

The ID of the AVS.

_authorizeUpgrade

Allows the owner to upgrade the AVS registry implementation.

function _authorizeUpgrade(address newImplementation) internal override onlyOwner;

Parameters

NameTypeDescription

newImplementation

address

The implementation to upgrade to.

Last updated