This repository contains a collection of contracts for managing Majoraies 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:
The MajoraVaultFactory
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.
The MajoraVaultManagement
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 Majoraies, including public access, whitelisted addresses, and holder requirements. It also supports timelock restrictions and deposit limits for both users and the vault.
The MajoraOperatorProxy
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.
The MajoraBlockRegistry
contract allows the registration and removal of Strategy blocks. Blocks represent different Majoraies 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.
The MajoraAssetBuffer
contract provides a minimalistic mutualized buffer for Strategy vaults. Users can deposit assets into the buffer, which temporarily holds the assets outside the vault Majoraies accounting. This allows for easier asset management and flexibility within the ecosystem.
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.
To contribute or make changes to these contracts, follow these steps:
-
Clone the repository:
git clone https://gitlab.com/murphy-labs/Majora-protocol/contracts/core.git
-
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
-
Make the desired changes to the contract files.
-
Compile the contracts:
npx hardhat compile
-
Run the tests to ensure everything is working as expected:
npx hardhat test
-
Submit a pull request with your changes for review.
This project is licensed under the BUSL-1.1 license. Please refer to the individual contract files for their specific license information.
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.