> For the complete documentation index, see [llms.txt](https://docs.satlayer.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satlayer.xyz/bvs-developers-1/satlayer-core-contracts.md).

# SatLayer Core Contracts

This document presents an overview of the system components, contracts, and user roles, detailing a total of 10 core smart contracts within the BVS framework.

* [**BVS Directory**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/bvs-directory) for registering BVS contracts.
* [**State Bank**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/state-bank) for managing relevant BVS task data.
* [**BVS Driver**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/bvs-driver) for managing BVS task lifecycle.
* [**Strategy Manager**](https://github.com/satlayer/satlayer-core/tree/main/contracts/devnet-strategy-manager) for managing the various assets accepted as collateral.
  * [Strategy Base](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/strategy-base)
  * [Strategy Factory](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/strategy-factory)
  * [Strategy Base TVL Limits](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/strategy-base-TVLLimits)
* [**Delegation Manager**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/delegation-manager) for managing the delegation and withdraw of staker assets to operators.
* [**Rewards Coordinator**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/rewards-coordinator) for managing the deposit and distribution of BVS token rewards.
* [**Slash Manager**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/slash-manager) for managing the report and execution of asset slashing.

<figure><img src="/files/sPbRdmcmXZqsXhQJn9g2" alt=""><figcaption></figcaption></figure>

BVS developers need to focus on contracts including **`BVSDirectory`**, **`BVSDriver`** and **`StateBank`**.&#x20;

To deploy a live BVS, you will need to:

1. Write, compile, and deploy your BVS Service Contracts.
2. Register your [TaskInterface](/bvs-developers-1/bvs-service-contracts.md#taskinterface-contract) contract with the BVS Director
3. Your TaskInterface contract should call the StateBank then the BVSDriver

The BVS contracts you develop will interface with these three primary contracts. Additional contracts handle functions like delegation, staking, slashing, and more. For further details, please refer to [Staking and Delegation](/bvs-developers-1/staking-and-delegation.md).  Refer to [Contract Addresses](/security/contracts.md#satlayer-core-contracts) to find all deployed core contract addresses and their corresponding explorer links.

## BVSDirectory

The [**BVSDirectory**](https://github.com/satlayer/satlayer-core/tree/main/contracts/bvs-directory) manages interactions between **BVS Services Contracts** and the **SatLayer Core Contracts**. Once registered as an Operator in the SatLayer core (via `DelegationManager`), Operators can register with one or more BVSs (via the BVS's contracts) to start providing off-chain services to them. When an Operator registers with a BVS, the BVS records this registration in the core contracts by interfacing with the `BVSDirectory`.

The functions of the BVSDirectory include:

* [Register BVS](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-directory/src/contract.rs#L137): Registers the BVS info to BVSDirectory contract.
* [Register/Deregister Operator](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-directory/src/contract.rs#L154): adds or removes an Operator from a specific BVS
* Read Only query functions for retrieving on-chain data to be used by off-chain programs.

## StateBank

The [**StateBank**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/state-bank) module manages the on-chain state data. It uses the set method to store task states on the blockchain and broadcasts state changes via event logs (event updateState).&#x20;

`StateBank` serves as the central state management system, providing storage and updates for tasks throughout their lifecycle.

The functions provided in the `StateBank` include:

* **Set On-Chain State**: Sets a `key, value` pair in the *StateBank* contract, where the key is a string and the value is an int64.
* **Register a BVS**: Registers the final `TaskInterface` contract of a BVS Service, required for `StateBank` to accept new state data.
* **Get Method**: Provides a method to query on-chain state data.

## BVSDriver

The [**BVSDriver**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/bvs-driver) module is responsible for managing the BVS task lifecycle within SatLayer. It triggers the execution of BVS off-chain operations via the run BVS method and notifies other modules when a task starts. The `BVSDriver` connects with the `StateBank` module to retrieve relevant task state and passes this information along to the BVS off-chain program.

Provided functions are as follows:

* [Set Task Id](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-driver/src/contract.rs#L43): to emit a new task event for off-chain program.
* [Register a BVS](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-driver/src/contract.rs#L64) Service's final `TaskInterface` contract, this is required for BVSDriver to accept tasks. &#x20;

The functions provided in the `BVSDirectory` include:

* [Set Task ID](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-driver/src/contract.rs#L43): Emits a new task event for the off-chain program.
* [Register a BVS](https://github.com/satlayer/devnet-satlayer-core/blob/main/contracts/bvs-driver/src/contract.rs#L64): Registers the final `TaskInterface` contract of a BVS Service, which is required for `BVSDriver` to accept tasks.

## SlashManager

{% hint style="info" %}
This section is non-final and subject to change.  Slashing and its Governance is extremely important to SatLayer, and is still an area of active research.
{% endhint %}

The [**SlashManager**](https://github.com/satlayer/devnet-satlayer-core/tree/main/contracts/slash-manager) contract is primarily responsible for penalizing Operators engaged in invalid or malicious activities. The contract owner can designate **Validators** who will sign and verify slash requests on-chain.  The number of Validators who verify slashing should exceeds a minimum threshold for enhanced security and fairness in executing slashes.

Additionally, **Slasher** roles, appointed by the contract owner, are granted the ability to submit, cancel, and execute slashes. During slash execution, the shares delegated by Stakers to the affected Operator are reduced, with the penalties evenly distributed among all Stakers who delegated to that Operator. Only **Slasher** roles can submit, execute, or cancel slash requests.

## Other Contracts

The remaining SatLayer Core Contracts manage functions like staking, delegation, operator coordination, and reward distribution. While these details aren't immediately relevant for developing a BVS service, you can refer to the  [**Staking, Delegation and Rewards Distribution**](/bvs-developers-1/staking-and-delegation.md#contracts-introduction) sections for a deeper understanding of how these contracts operate.
