Operator Management

This guide covers steps to deploy AVS Governance hook contract for Operator Management

Prerequisites

  • AVS contracts

  • Access to AVS governance multisig

1

Set Up the Contract

Create a contract called AVSGovernanceLogic , use IAVSGovernanceLogic interface to override beforeOperatorRegistered, beforeOperatorRegistered, beforeOperatorUnregistered, afterOperatorUnregistered

contract AvsGovernanceLogic is IAvsGovernanceLogic {

}
2

Deploy the contract

After implementation, deploy the contract on the same L1 network as the AVSGovernance.

3

Register AVSLogic with AttestationCenter

After deployment, you must call the setAvsGovernanceLogic function on the AvsGovernance , providing the address of the AvsGovernanceLogic contract as a parameter, as shown in the below example.

Script to execute setAvsGovernanceLogic function
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

/*______     __      __                              __      __ 
 /      \   /  |    /  |                            /  |    /  |
/$$$$$$  | _$$ |_   $$ |____    ______   _______   _$$ |_   $$/   _______ 
$$ |  $$ |/ $$   |  $$      \  /      \ /       \ / $$   |  /  | /       |
$$ |  $$ |$$$$$$/   $$$$$$$  |/$$$$$$  |$$$$$$$  |$$$$$$/   $$ |/$$$$$$$/ 
$$ |  $$ |  $$ | __ $$ |  $$ |$$    $$ |$$ |  $$ |  $$ | __ $$ |$$ |
$$ \__$$ |  $$ |/  |$$ |  $$ |$$$$$$$$/ $$ |  $$ |  $$ |/  |$$ |$$ \_____ 
$$    $$/   $$  $$/ $$ |  $$ |$$       |$$ |  $$ |  $$  $$/ $$ |$$       |
 $$$$$$/     $$$$/  $$/   $$/  $$$$$$$/ $$/   $$/    $$$$/  $$/  $$$$$$$/
*/
/**
 * @author Othentic Labs LTD.
 * @notice Terms of Service: https://www.othentic.xyz/terms-of-service
 */

import {Script, console} from "forge-std/Script.sol";
import "../src/IAvsGocernance.sol";
import "../src/AvsGovernanceLogic.sol";

// forge script AvsGovernanceLogicScript --rpc-url $L1_RPC --private-key $PRIVATE_KEY
// --broadcast -vvvv --verify --etherscan-api-key $L1_ETHERSCAN_API_KEY --chain
// $L1_CHAIN --verifier-url $L1_VERIFIER_URL --sig="run(address)" $ATTESTATION_CENTER_ADDRESS
contract AvsGovernanceLogicScript is Script {
    function setUp() public {}

    function run(address avsGovernance) public {
        vm.broadcast();
        AvsGovernanceLogic avsGovernanceLogic = new AvsGovernanceLogic(avsGovernance);
        IAvsGovernance(avsGovernance).setAvsGovernanceLogic(address(avsGovernanceLogic));
    }
}

Note that only the AVS Governance Multisig is authorized to call this function.

4

Verify the Hook contract


Last updated