Contracts Deployment
Creating a new AVS requires deploying contracts on-chain.
Last updated
Creating a new AVS requires deploying contracts on-chain.
Last updated
Othentic CLI streamlines the deployment of contracts for a new AVS and allows users to configure various options.
The following contracts are deployed:
AvsGovernance for managing operators and governance policies.
L1MessageHandler endpoint for broadcasting messages to the L2 contracts.
L1AvsTreasury contract for managing rewards and handling protocol fee.
The following contracts are deployed:
AttestationCenter for task verification and historical footprint.
OBLS implements Multisig operations.
cryptographic logical contract used by OBLS
L2MessageHandler complementary to l1MessageHandler
, used for communicating with L1 components
L2AvsTreasury contract for managing rewards and handling protocol fee.
To minimize costs and availability associated with running your AVS, AvsGovernance
and AttestationCenter
are being deployed on L1 and L2 (respectively). The Othentic Stack utilizes DVN to exchange messages between the layers. L1MessageHandler interacts directly with AvsGovernance
and L2MessageHandler interacts directly with AttestationCenter
.
ERC-20 token to back the network.
Othentic CLI installed. See Quick Start.
Only Supported Networks can be used for deployment.
Othentic CLI uses .env
files for configuration. For the deployment, you need following variables in your .env file:
The private key should be a 64-character hex string without the "0x" prefix.
Specify L2_CHAIN
and L1_CHAIN
in the .env
file to avoid needing to add --l2-chain
to every command. The configuration follows this priority:
If both --l1-chain (command)
and L1_CHAIN (.env)
are set, the command flag will override the .env
value.
If neither is provided, the default value of 17000/holesky
(or 80002/amoy
for L2) is applied.
The contract cloning process uses SSH to clone a private github repository. Make sure your SSH keys are configured properly on Github before running the deployment process.
Define the following properties:
Define either:
a. --erc20
the address of the token backing the AVS
b. --eth
to use native ETH to back the AVS
--l1-initial-deposit
and --l2-initial-deposit
is the initial deposit for messaging tokens from Layers 1 & 2 (in wei)
--avs-governance-multisig-owner
the address of the AVS Governance Multisig role (if you don't pass this flag then the deployer is set as AVS Governance Multisig owner by default)
--l2-rewards
rewards distribution to operators on L2 instead of L1 (Optional)
--l1-chain
and --l2-chain
parameters to define the chains.
Refer to the Supported Networks page to learn about all the chains that are supported.
Example using ERC-20 token:
Example using native ETH:
Example using rewards on L2:
After execution, the deployment output will be stored in the file:
Use this command to display the deployed addresses associated with the AVS:
The Othentic CLI allows managing AVS network flows through pause-flow and unpause-flow commands. These commands enable AVS governance multi-sig to halt or resume specific flows across Layer 1 and Layer 2.
By default all the flows are unpaused, except the Payments and Batch Payments.
This command pauses specific AVS operations. It lists all available flows, allowing you to select and pause a specific flow.
This command resumes previously paused AVS operations. It lists all available flows, allowing you to select and un-pause a specific flow.
When prompted, enter the private key of the AVS governance multi-sig address and select the flow.
If the selected flow is already paused, the system throws: Error:
Selected Flow is already paused
Operator Registration: Pausing prevents new operators from registering on the AVS.
Operator Updating Receiver: Pausing disables the ability to update the operator's reward receiver.
Update AVS Strategies: Pausing prevents any updates to the AVS strategies.
Payments: Pausing halts operator payments.
Batch Payments: Pausing disables Batch payments to operators.
Update AVS Logic: Pausing prevents changes to the AVS logic.
Create AVS Task Definition: Pausing disables the creation of new Task Definitions.
Task Submission: Pausing prevents on-chain task submissions.
Othentic CLI enables depositing rewards into the AVS treasury. It supports both ERC-20 tokens and native ETH, ensuring an automated approval check before initiating the deposit process.
The service deposits rewards into the treasury using depositNative or depositERC20 methods.
Required Argument:
--amount
: Specifies the token amount to be deposited.
When prompted, enter the private key of the AVS governance multi-sig address.
At the end, the CLI will display the transaction hash.
The Othentic CLI enables you to configure staking contracts for an AVS. It internally calls setSupportedStakingContracts method on AVSGovernance contract.
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the AVS governance address
A list of supported staking contracts will be displayed. Select one or more from the list and confirm your selection.
If you need to deploy a new strategy on shared security provider (e.g., Eigen), follow these steps:
Use the shared security provider's deployNewStrategy method to deploy the strategy for an ERC20 token.
Ensure the newly deployed strategy is whitelisted.
Once whitelisted, run the othentic-cli network set-strategies
command to set the new strategy to your AVS
.
At the end, the CLI will display the transaction hash.
Othentic CLI enables you to configure minimum stake for a staking contract. It internally calls setMinSharesForStrategy method on the AVS governance contract.
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the AVS governance address
A list of supported staking contracts will be displayed, select a staking contract.
Enter the minimum share value.
At the end, the CLI will display the transaction hash.
Othentic CLI enables you to set minimum voting power for an AVS. This ensures that only operators with sufficient voting power can influence the consensus. It internally calls setMinVotingPower method on the AVS governance contract. By default, the minimum voting power is set to 0.
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the AVS governance address
Enter the minimum voting power value.
At the end, the CLI will display the transaction hash.