# AVS Governance

<table data-view="cards"><thead><tr><th></th><th data-hidden data-type="content-ref"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>View Source Code</td><td><a href="https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol">https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol</a></td><td><a href="https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol">https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol</a></td></tr></tbody></table>

## Overview

The [AVS Governance contract](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol) acts as the interface of the AVS on Ethereum blockchain (L1).&#x20;

It manages the registration and de-registration of operators, enforces governance policies, and coordinates interactions between AVS operators and various system components. The AVS Governance uses roles and access-control authorizations to manage permissions, handle operator deposits and rewards, and allow for the update of governance logic and settings.&#x20;

Additionally, it interfaces with other contracts for message handling, registry management, and signature verification to maintain the integrity and functionality of the AVS.

{% hint style="info" %}
Each AVS deploys its own AVS Governance contract, managed via multiple [Governance Multisigs](https://docs.othentic.xyz/main/learn/advanced-concepts/governance-multisig).
{% endhint %}

## Write Methods

### Operator Registration

These methods are used to manage Operator registration/de-registration.

#### [registerAsOperator](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L1/AvsGovernance.sol#L110)

Register to non-allowlisted AVSs. If the AVS registration is permissionless, anyone can register as long as they comply with the AVS' minimum requirements.

<table><thead><tr><th width="215.17327880859375">Parameter</th><th width="218.59027099609375">Type</th><th>Description</th></tr></thead><tbody><tr><td>_blsKey</td><td>uint256[4]</td><td>The operator's public BLS key</td></tr><tr><td>_rewardsReceiver</td><td>address</td><td>The address to which operator rewards should be sent</td></tr><tr><td>_blsRegistrationSignature</td><td><a href="https://github.com/Othentic-Labs/contracts/blob/a5090918328bb0b4267ab3118bd00785a813b0bd/src/NetworkManagement/Common/BLSAuthLibrary.sol#L24">BLSAuthLibrary.Signature</a></td><td>The operator signature required by EigenLayer</td></tr><tr><td>authToken</td><td>bytes</td><td>A BLS signature (see note below)</td></tr></tbody></table>

{% hint style="info" %}
The `_blsRegistrationSignature` parameter is a BLS signature:

* Domain: `keccak256("OthenticBLSAuth")`
* Message: `keccak256(abi.encode(msg.sender, avsGovernanceAddress, block.chainid))`
  {% endhint %}

#### registerOperatorToEigenLayer

It registers as an operator on EigenLayer using the provided signature and authentication token.

<table><thead><tr><th width="153.68359375">Parameter</th><th width="248.725830078125">Type</th><th width="345.775146484375">Description</th></tr></thead><tbody><tr><td>_eigenSig</td><td>SignatureWithSaltAndExpiry</td><td>signature details</td></tr><tr><td>_authToken</td><td>bytes</td><td>authentication token</td></tr></tbody></table>

### Operator De-registration

To unregister an Operator from the AVS, call the following methods:

#### unregisterAsOperatorFromAvs

Unregister as an operator from the AVS. This method receives no arguments.

#### unregisterAsOperatorFromEigenLayer

Unregister as an operator from the EigenLayer. This method receives no arguments.

### Operator Rewards Receiver Update

To update rewards receiver address for an Operator, call the following methods:

#### queueRewardsReceiverModification

Update the rewards receiver address

<table><thead><tr><th width="196.07421875">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newRewardsReceiver</td><td>address</td><td>New rewards receiver address</td></tr></tbody></table>

#### completeRewardsReceiverModification

Complete the rewards receiver address modification

### **General AVS Configuration**

#### setAvsName(string)

Set a human-readable identifier for your AVS contract.

<table><thead><tr><th width="279">Parameter</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td>_avsName</td><td>string</td><td>New AVS name</td></tr></tbody></table>

#### setAvsGovernanceMultisig(address)

Set the account that is authorized to invoke the governance methods.

<table><thead><tr><th width="279">Parameter</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newAvsGovernanceMultisig</td><td>address</td><td>The new governance owner</td></tr></tbody></table>

#### setAvsGovernanceLogic(IAvsGovernanceLogic)

Connect an [`AvsLogic`](https://docs.othentic.xyz/main/user-guide/network-management/hooks/task-logic) contract to the governance contract. Learn more [here](https://docs.othentic.xyz/main/learn/advanced-concepts/hooks/task-logic).

<table><thead><tr><th width="212">Parameter</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td>_avsGovernanceLogic</td><td>IAvsGovernanceLogic</td><td>Address of an AvsLogic contract</td></tr></tbody></table>

#### transferAvsGovernanceMultisig

Transfer control of the AVS governance to a new multisig wallet.

<table><thead><tr><th width="251.0390625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newAvsGovernanceMultisig</td><td>address</td><td>Address of the AVS governance multisig</td></tr></tbody></table>

#### setRewardsReceiverModificationDelay

Set the required delay before updating the rewards receiver address, by default its 7 days.

<table><thead><tr><th width="258.53515625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_rewardsReceiverModificationDelay</td><td>uint256</td><td>delay in milliseconds</td></tr></tbody></table>

#### setAvsGovernanceMultiplierSyncer

Set the address responsible for syncing the AVS governance multiplier

<table><thead><tr><th width="251.0390625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newAvsGovernanceMultiplierSyncer</td><td>address</td><td>AVS governance multiplier syncing address</td></tr></tbody></table>

***

### Consensus **Configuration**

#### setNumOfOperatorsLimit(uint256)

Limit the amount of active operators allowed on the AVS at any given moment.

<table><thead><tr><th width="279">Parameter</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newLimitOfNumOfOperators</td><td>uint256</td><td>The new limit for the number of operators</td></tr></tbody></table>

#### setMinVotingPower(uint256)

Set the [Minimum Voting Power](https://docs.othentic.xyz/main/learn/core-concepts/voting-power#minimum-voting-power) required to register an operator to the AVS.&#x20;

| Parameter        | Type    | Description          |
| ---------------- | ------- | -------------------- |
| \_minVotingPower | uint256 | minimum voting power |

#### setMaxEffectiveBalance(uint256)

Set the [Maximum Effective Balance](https://docs.othentic.xyz/main/learn/core-concepts/voting-power#maximum-voting-power) for the AVS.

| Parameter    | Type    | Description               |
| ------------ | ------- | ------------------------- |
| \_maxBalance | uint256 | maximum effective balance |

***

### **Staking Configuration**

#### setSupportedStakingContracts(StakingContractInfo\[])

Set the list of EigenLayer strategies supported by the AVS.

<table><thead><tr><th width="212">Parameter</th><th width="216.35870361328125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_stakingContractsDetails</td><td>StakingContractInfo[]</td><td>List of staking contracts supported by the AVS</td></tr></tbody></table>

#### setMinStakePerStakingContract (address, uint256)

Sets the minimum stake amount for a specified staking contract

<table><thead><tr><th width="167.46484375">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_stakingContract</td><td>address</td><td>The address of the Staking contract</td></tr><tr><td>_minStake</td><td>uint256</td><td>The minimum stake (in wei) required from an Operator in the given staking contract to be considered eligible.</td></tr></tbody></table>

#### setStakingContractMultiplier

Sets the voting power multiplier for a specified staking contract, it can only be called by Multipler syncer

`multiplier` is the weight assigned to a particular staking contract, which you can configure as per your requirements for each staking contract. Multipliers directly influences voting power and must be a positive integer.

**Parameters:**

* `_votingPowerMultiplier` : `VotingPowerMultiplier` struct containing

<table><thead><tr><th width="200.3671875">Parameter</th><th width="207.48046875">Type</th><th>Description</th></tr></thead><tbody><tr><td>stakingContract</td><td>address</td><td>Address of the Staking contract</td></tr><tr><td>multiplier</td><td>uint256</td><td>The voting power multiplier applied to the stake from the specified staking contract</td></tr><tr><td>slashableStakeWeight</td><td>uint256</td><td>Unique Stake Weight in the voting power</td></tr><tr><td>sharedSecurityProvider</td><td>SharedSecurityProvider</td><td>Use <code>0</code> for Eigen Layer</td></tr></tbody></table>

#### setStakingContractMultiplierBatch

Sets the voting power multipliers for multiple staking contracts, it can only be called by Multipler syncer

<table><thead><tr><th width="214.6484375">Parameter</th><th width="127.6953125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_votingPowerMultipliers</td><td>VotingPowerMultiplier[]</td><td>Voting power multipliers</td></tr></tbody></table>

#### setStakingContractPriceFeed

Registers or updates the price feed (oracle) address for a given staking contract. This oracle contract is expected to implement the [AggregatorV3Interface](https://docs.chain.link/data-feeds/api-reference#aggregatorv3interface), used for token price feeds.

<table><thead><tr><th width="167.45703125">Parameter</th><th width="95.9140625">Type</th><th>Description</th></tr></thead><tbody><tr><td>_stakingContract</td><td>address</td><td>The address of the staking contract whose associated price feed is being set</td></tr><tr><td>_feed</td><td>address</td><td>The address of the price feed contract implementing the <code>AggregatorV3Interface</code></td></tr></tbody></table>

***

### **Rewards Configuration**

#### createEigenRewardsSubmission

Distribute a fixed amount of rewards to the Operators

<table><thead><tr><th width="159.4921875">Parameter</th><th width="104.11328125">Type</th><th>Description</th></tr></thead><tbody><tr><td>startTimestamp</td><td>uint32</td><td>Timestamp (in seconds) indicating from when to start calculating which Operators and Stakers are eligible to claim rewards.</td></tr><tr><td>duration</td><td>uint32</td><td>Duration in seconds to define the Operators and Staker actively participating in the AVS (e.g., 604800 for 7 days).</td></tr><tr><td>amount</td><td>uint256</td><td>Total amount of tokens in wei</td></tr></tbody></table>

***

### **P2P and Authentication Settings**

#### setIsAllowlisted

Set allow list functionality

<table><thead><tr><th width="251.0390625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_isAllowlisted</td><td>boolean</td><td>is allowed boolean value</td></tr></tbody></table>

#### setP2pAuthenticationEnabled(bool)

Enable [p2p authentication](https://docs.othentic.xyz/main/learn/advanced-concepts/p2p-networking/auth-layer) for the AVS network. Learn more [here](https://docs.othentic.xyz/main/learn/advanced-concepts/p2p-networking/auth-layer).

<table><thead><tr><th width="252.48828125">Parameter</th><th width="137.4765625">Type</th><th>Description</th></tr></thead><tbody><tr><td>_p2pAuthenticationEnabled</td><td>bool</td><td>value to set</td></tr></tbody></table>

***

### External Functions

#### registerAvsToEigenLayer(string)

Register AVS to EigenLayer dashboard. Learn more [here](https://docs.othentic.xyz/main/reference/othentic-cli/network/register).

<table><thead><tr><th width="211.22265625">Parameter</th><th width="93.7421875">Type</th><th>Description</th></tr></thead><tbody><tr><td>metadataURI</td><td>string</td><td>The metadataURI <a href="https://docs.eigenlayer.xyz/developers/HowTo/publish/onboard-avs-dashboard#metadatauri-format">format</a> </td></tr></tbody></table>

#### rescueFunds

Withdraw stuck funds from the AVS Governance contract to the AVS governance multisig.

### Slashing Module Configuration

{% hint style="info" %}
In this context, `slashingCondition` corresponds to [Slashing Modules](https://docs.othentic.xyz/main/learn/core-concepts/slashing-and-ejection/modules).
{% endhint %}

#### updateSlashingConfig

Create or update the configuration for a specific slashing module.

See [Slashing Modules](https://docs.othentic.xyz/main/learn/core-concepts/slashing-and-ejection/modules) and [Enable Slashing](https://docs.othentic.xyz/main/user-guide/network-management/slashing-setup) pages to learn more.

```solidity
function updateSlashingConfig(
    SlashingCondition _condition,
    SlashingConfig _config
) external;

enum SlashingCondition {
    None, // 0
    DoubleAttestations, // 1
    RejectedTask, // 2
    IncorrectAttestations // 3
}
```

**Parameters**

* `_condition`: The specific `SlashingCondition` enum value (i.e. 1/2/3) you want to update (e.g., `DoubleAttestations`, `IncorrectAttestations`).
* `_config`:  `SlashingConfig` struct containing.

<table><thead><tr><th width="215.17578125">Parameter</th><th width="83.5078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>activated</td><td>bool</td><td>Enable/ disable this slashing condition</td></tr><tr><td>ejectOperator</td><td>bool</td><td>Auto-eject operator on violation</td></tr><tr><td>stakeSlashedPercentage</td><td>uint24</td><td><p>% of unique stake to slash in <strong>million-based denomination</strong>. Where:</p><ul><li><code>1_000_000</code> = 100%</li><li><code>100_000</code> = 10%</li></ul></td></tr></tbody></table>

#### getSlashingConfig

Returns the current slashing configuration for a given condition.

```solidity
function getSlashingConfig(
    SlashingCondition _condition
) external view returns (SlashingConfig);
```

<table><thead><tr><th width="127.3203125">Parameter</th><th width="163.9453125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_condition</td><td>SlashingCondition</td><td> <code>SlashingCondition</code> enum value specifying the slashing condition to query (e.g., DoubleAttestations, IncorrectAttestations).</td></tr></tbody></table>

#### setMinSlashableStakePerStakingContract

This function specifies the **minimum slashable stake** required in a given staking contract. Operators who have staked **less than the defined threshold** will be considered **inactive.**

```solidity
function setMinSlashableStakePerStakingContract(
    address _stakingContract, 
    uint256 _minSlashableStake)
```

**Parameters**

<table><thead><tr><th width="194.859375">Parameter</th><th width="108.4765625">Type</th><th>Description</th></tr></thead><tbody><tr><td>_stakingContract</td><td>address</td><td>The address of the staking contract to configure.</td></tr><tr><td>_minSlashableStake</td><td>uint256</td><td>The minimum amount of required stake (in wei) </td></tr></tbody></table>

***

## View Methods

### **General AVS Configuration**

<table><thead><tr><th width="272.5390625">Function</th><th>Description</th></tr></thead><tbody><tr><td>avsName</td><td>Returns the name of the AVS</td></tr><tr><td>avsTreasury</td><td>Returns the address of the AVS treasury contract</td></tr><tr><td>getL1MessageHandler</td><td>Returns the address of the L1 <a href="message-handlers">message handler </a>contract</td></tr><tr><td>avsDirectory</td><td>Returns the address of the AVS directory contract</td></tr><tr><td>EXTENSION_IMPLEMENTATION</td><td>Returns the address of the extension contract exposing additional functions.</td></tr></tbody></table>

### Consensus Configuration

<table><thead><tr><th width="252.83203125"></th><th></th></tr></thead><tbody><tr><td>minVotingPower</td><td>Returns the <a href="../../../learn/core-concepts/voting-power#minimum-voting-power">minimum voting power</a> required</td></tr><tr><td>maxEffectiveBalance</td><td>Returns the <a href="../../../learn/core-concepts/voting-power#maximum-voting-power">maximum effective balance</a> allowed</td></tr><tr><td>getNumOfOperatorsLimit</td><td>Returns the maximum number of operators allowed</td></tr></tbody></table>

### Operator Status

<table><thead><tr><th width="416.05755615234375">Function</th><th width="331.55859375">Description</th><th data-hidden></th></tr></thead><tbody><tr><td>isOperatorRegistered(address)</td><td>Checks whether a given <code>operator</code> address is registered</td><td></td></tr><tr><td>getRewardsReceiver(address)</td><td>Returns rewards receiver address for the Operator</td><td></td></tr><tr><td>votingPower(address)</td><td>Returns <a href="../../learn/core-concepts/voting-power">voting power</a> of the Operator</td><td></td></tr><tr><td>getOperatorRestakedStrategies(address)</td><td>Returns the strategies restaked by the Operator</td><td></td></tr><tr><td>votingPowerPerStakingContracts(address, address[])</td><td>Returns Voting power for the specified Staking contracts</td><td></td></tr><tr><td>getIsOperatorEjected(address)</td><td>Returns whether an operator is blacklisted</td><td></td></tr></tbody></table>

### **Authentication Configuration**

<table><thead><tr><th width="256.2109375">function</th><th>description</th></tr></thead><tbody><tr><td>p2pAuthenticationEnabled</td><td>Returns a boolean value indicating whether <a href="../../learn/advanced-concepts/p2p-networking/auth-layer">P2P authentication</a> is enabled</td></tr><tr><td>getIsAllowlisted</td><td>Returns a boolean indicating whether Operator allowlisting is enabled</td></tr></tbody></table>

### **Staking** Configuration

<table data-full-width="false"><thead><tr><th width="313.04718017578125">function</th><th width="433.399169921875">description</th><th data-hidden></th></tr></thead><tbody><tr><td>getRestakeableStrategies</td><td>Returns restakable strategies for the AVS</td><td></td></tr><tr><td>minStakeAmountPerStakingContract</td><td>Returns the minimum stake amount required for a given staking contract</td><td></td></tr><tr><td>stakingContracts</td><td>Returns an array of registered staking contract addresses</td><td></td></tr></tbody></table>
