Skip to content

Audit/omnistaking #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 441 commits into
base: master
Choose a base branch
from
Open

Audit/omnistaking #88

wants to merge 441 commits into from

Conversation

paul-ilvez
Copy link
Contributor

Description

This pull request introduces the Omnistaking feature, enabling cross-chain invariants between L2 chains and L1, along with the seamless transition of ETH between L2 and L1. The feature is implemented using LayerZero-based cross-chain bridges and involves significant additions and updates across the project structure, smart contracts, and migration scripts. All code has been audited by Salus.

Goal
The goal of this PR is to establish a foundation for Omnistaking, enabling scalable and seamless interactions between L1 and L2 chains.

Key Highlights

Cross-Chain Invariants:

  • Maintains the invariant: token_balances (L1) == sum(token_balances(L2)).
  • Synchronizes states across L1 and L2 chains, ensuring balance parity and consistency.
  • ETH Transition Between L1 and L2:
  • Supports the movement of ETH between L1 and L2 chains using robust LayerZero cross-chain messaging infrastructure.

New Folder Structure:

  • The project structure has been updated to accommodate the new functionality:
  • bridge-lz: Implements cross-chain bridges.
  • restaking-pool: Contains L1 smart contracts.
  • vaults: Contains L2 smart contracts.
  • tests: Includes unit tests for new contracts and functionality.

Prominent Smart Contracts:

  • NativeRebalancer: Implements native rebalancing logic for token management.
  • LZCrossChainAdapterL1: Facilitates LayerZero-based cross-chain communication on L1.
  • LZCrossChainAdapterL2: Handles LayerZero-based cross-chain communication on L2.
  • InceptionOmniVault: Manages vault operations with cross-chain deposit and withdrawal capabilities
  • Includes associated dependencies and helper contracts.

Migration Scripts:

Migration scripts for deploying and upgrading contracts:

L1:

  • 13_update_pool.ts: Updates the RestakingPool contract.
  • 14_update_protocol_config.ts: Updates protocol configurations for cross-chain compatibility.
  • 15_deploy_native_rebalancer.ts: Deploys the NativeRebalancer contract.
  • 16_update_crosschain_adapter_l1.ts: Configures the LZCrossChainAdapterL1 for cross-chain communication.

L2:

  • vaults/scripts/migration/mainnet/vaults/deploy-iov.ts: Deploys the InceptionOmniVault contract on L2.

Cross-Chain Bridges

  • projects/bridge-lz/deploy/LZCrossChainAdapterL1.ts: Deploys LayerZero L1 cross-chain adapter.
  • projects/bridge-lz/deploy/LZCrossChainAdapterL2.ts: Deploys LayerZero L2 cross-chain adapter.

Testing

Unit tests cover key functionalities such as cross-chain communication, ETH transfers, and state reconciliation.
Manual testing and audit by Salus have been conducted to validate the integration of migration scripts and ensure successful deployments.
Impact and Benefits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants