1.0.1 • Published 9 months ago
@majora-finance/merkl-blocks v1.0.1
Majora Blocks
This repository contains the smart contract blocks for the Majora Finance protocol. These blocks are modular components that can be composed together to create complex DeFi strategies.
Overview
The repository contains two main swap blocks:
- MajoraGammaQuickDepositBlock: A block to deposit in Gamma - Quick pools
- MajoraGammaUniDepositBlock: A block to deposit in Gamma - Uni pools
- AlgebraFeeCalculator: A library to compute pending fees for Algebra pools
- UniswapV3FeeCalculator: A library to compute pending fees for Uni pools
Installation
npm install --forceDevelopment Setup
- Install dependencies:
npm install --force- Create a
.envfile with the following variables:
POLYGON_RPC=<your-polygon-rpc-url>- Compile contracts:
npx hardhat compileTesting
Run the test suite:
npx hardhat coverageDeployment
- Deploy blocks:
npx hardhat deploy --tags MajoraBlocks- Register blocks:
npx hardhat deploy --tags RegisterBlocksBlock Configuration
Blocks can be configured using YAML files in the devkit-config directory. Example configuration:
BlockParameters:
- attribute: token
type: address
value: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
- attribute: tokenInPercent
type: uint256
value: 100
- attribute: tokenOut
type: address
value: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"Block Metadata
Block metadata is defined in YAML files in the blocks-metadata directory. This includes:
- Block identification
- Parameter definitions
- Protocol information
- Resolver configurations
License
MIT