Skip to content

ssvlabs/based-applications

Repository files navigation

👷 🔐 Based Applications Contracts

🚧 CAUTION: This repo is currently under heavy development! 🚧

We strongly advise you to work with releases tags. Please, check what version the SSVBasedApp.sol is using by calling getVersion().

 

CI Tests License: GPL-3.0

 

📖 Description

This repository contains the SSV Based Applications Platform Contracts.

The contracts are organized under the src/ directory into two main folders:

  • core/: contains the main platform contract: SSVBasedApps.sol;

  • middleware/ contains the module contracts to build a based application.

The Core Platform

The core contract is build in a diamond-like pattern:

  • SSVBasedApps.sol – Core contract where all the functions are declared and via an internal proxy it redirects to the right implementation.

The functions are implemented in 3 different modules:

  • StrategyManager.sol – Implements functions related to strategies, validator balance delegation, opting-in to bApp, and slashing;

  • BasedAppsManager.sol – Implements functions related to bApps like the registration and update the metadata;

  • PlatformManager.sol – Implements functions for updating the global variables like timelocks length, max number of shares, etc. The variable update process will be handled by the SSV DAO.

The Middleware

This middleware folder contains the modules for building a bapp:

  • modules/core: the base layer for a bApp to be compliant and be recognized by the system;

  • examples: contains example of working compliant bApps.

 

📃 Instructions

1) Fire up your favorite console & clone this repo somewhere:

❍ git clone https://github.com/ssvlabs/based-applications.git

2) After selecting the right branch, enter this directory & install dependencies:

❍ forge install

3) Compile the contracts:

❍ forge build

4) Set the tests going!

❍ forge test

 

🔨 Slashing & Withdrawals Mechanisms

Slashing & Withdrawals

Generation pattern

⚙️ Feature Activation

Feature Activation

📄 Whitepaper

Whitepaper

📚 More Resources

Based Apps Onboarding Guide

🚀 Deployments

How to Deploy

2) Set the environment variables in the .env file.

1) Run the deployment script DeployAllHoodi.s.sol defined in script/:

❍ npm run deploy:hoodi-stage: verification is done automatically.

How to Update Module Contracts

It is possible to update each one of the three modules: StrategyManager, BasedAppsManager and ProtocolManager.

It is possible to update multiple modules at the same time.

1) Go on the Proxy Contract on Etherscan, under "Write as Proxy" call the function:

❍ updateModules: specifying the correct module id and the new module address.

How to Upgrade the Implementation Contract

1) Go on the Proxy Contract on Etherscan, under "Write as Proxy" call the function:

❍ upgradeToAndCall: specifying the new implementation address. The data field can be left empty in this case.

Public Testnet Hoodi

Name Proxy Implementation Notes
SSVBasedApps <pending> <pending> Proxy: [email protected]

 

📜 License

2025 SSV Network https://ssv.network/

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Packages

No packages published

Contributors 5