Task Logic
Learn more about Task Logic Hook
Prerequisites
AVS contracts
Access to AVS governance multisig
1
2
3
Register AVSLogic with AttestationCenter
After deployment, call the setAvsLogic function on the AttestationCenter and provide the address of the AvsLogic contract as the parameter, as shown in the script below.
Script to execute setAvsLogic 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/IAttestationCenter.sol";
import "../src/AvsLogic.sol";
// forge script AvsLogicScript --rpc-url $L2_RPC --private-key $PRIVATE_KEY
// --broadcast -vvvv --verify --etherscan-api-key $L2_ETHERSCAN_API_KEY --chain
// $L2_CHAIN --verifier-url $L2_VERIFIER_URL --sig="run(address)" $ATTESTATION_CENTER_ADDRESS
contract AvsLogicScript is Script {
function setUp() public {}
function run(address attestationCenter) public {
vm.broadcast();
AvsLogic avsLogic = new AvsLogic(attestationCenter);
IAttestationCenter(attestationCenter).setAvsLogic(address(avsLogic));
}
}Note that only the AVS Governance Multisig is authorized to call this function.
Last updated