npm package: @murphy-labs/strateg-protocol-core
Description: This repository contains a collection of contracts for managing strategies and related operations within a decentralized finance (DeFi) ecosystem. These contracts facilitate various functionalities such as strategy vault creation, asset buffering, operato
Latest version: 0.4.6

# Strateg Core Contracts

This repository contains a collection of contracts for managing strategies and related operations within a decentralized finance (DeFi) ecosystem. These contracts facilitate various functionalities such as strategy vault creation, asset buffering, operator proxy, block registry, and more. Below is an overview of each contract:

## Contracts

### StrategVaultFactory

The `StrategVaultFactory` contract is responsible for creating new strategy vaults. It allows users to deploy vault contracts with specified parameters such as name, symbol, underlying asset, strategy, fees, and more. The factory also provides functions for upgrading the vault and ERC3525 implementations, executing emergency operations, setting protocol fees, and retrieving information about owned vaults.

### StrategVaultManagement

The `StrategVaultManagement` contract serves as a middleware between users and the actual strategy vaults. It handles access control and deposit limits based on the defined middleware strategy. The contract implements various strategies, including public access, whitelisted addresses, and holder requirements. It also supports timelock restrictions and deposit limits for both users and the vault.

### StrategOperatorProxy

The `StrategOperatorProxy` contract acts as a proxy for executing operations on behalf of the operator. It enables the operator to perform actions such as vault harvesting, rebalancing, withdrawal rebalancing, and fee withdrawals. Only users with the `OPERATOR_ROLE` can access these functionalities.

### StrategBlockRegistry

The `StrategBlockRegistry` contract allows the registration and removal of strategy blocks. Blocks represent different strategies used within the ecosystem. The contract maintains a mapping of block addresses to their corresponding metadata, including the deployer, name, and IPFS hash. The registry enforces access control based on ownership or deployer role.

### StrategAssetBuffer

The `StrategAssetBuffer` contract provides a minimalistic mutualized buffer for strategy vaults. Users can deposit assets into the buffer, which temporarily holds the assets outside the vault strategies accounting. This allows for easier asset management and flexibility within the ecosystem.

## Usage

To use these contracts, you can deploy them individually or as part of a larger DeFi system. Each contract has specific functions and access control roles to manage various operations and configurations. You can interact with the contracts using the appropriate Ethereum wallet or smart contract interaction tool.

Please refer to the individual contract source code and associated documentation for detailed information on the functions, events, and usage instructions.

## Development

To contribute or make changes to these contracts, follow these steps:

1. Clone the repository:

   ```
   git clone https://gitlab.com/murphy-labs/strateg-protocol/contracts/core.git
   ```

2. Install the necessary dependencies:

   ```
   npm install --force
   ```

   The --force is mandatory because there is a package version conflict with hardhat-deploy but everything is working fine.
   There is no solution until we migrate on ethers v6

3. Make the desired changes to the contract files.

4. Compile the contracts:

   ```
   npx hardhat compile
   ```

5. Run the tests to ensure everything is working as expected:

   ```
   npx hardhat test
   ```

6. Submit a pull request with your changes for review.

## License

This project is licensed under the [BUSL-1.1](https://spdx.org/licenses/BUSL-1.1.html) license. Please refer to the individual contract files for their specific license information.

## Disclaimer

These contracts are provided as-is without any warranty or guarantee of any kind. Use them at your own risk. Always review and audit the code before deploying it in a production environment.