# mzs-automation-build-artifacts

Solidity source contracts for the MZS project. This package provides `.sol` files for direct import into Hardhat/Foundry projects, enabling proper contract verification on block explorers.

## Installation

```bash
npm install mzs-automation-build-artifacts
```

## Usage

Import Solidity contracts directly in your Hardhat/Foundry projects:

```solidity
// In your contracts
import "mzs-automation-build-artifacts/domains/morpho/contracts/Morpho.sol";
import "mzs-automation-build-artifacts/domains/morpho/contracts/TestingMetaMorpho.sol";
import "mzs-automation-build-artifacts/domains/aerodrome/contracts/Router.sol";
import "mzs-automation-build-artifacts/domains/aerodrome-slipstream/contracts/core/CLPool.sol";
```

## Solidity Contracts: Morpho Blue

### From [morpho-org/morpho-blue](https://github.com/morpho-org/morpho-blue)

Commit: `9686ec502c8583a76d30f31acd7f70a38aa30818`

- `Morpho`
- `ERC20Mock`
- `OracleMock`

### From [morpho-org/morpho-blue-irm](https://github.com/morpho-org/morpho-blue-irm)

Commit: `a7d9cce3451b4a106bfd40933ac57a785b5228f3`

- `AdaptiveCurveIrm`
- `FixedRateIrm`

### From [morpho-org/metamorpho](https://github.com/morpho-org/metamorpho)

Commit: `380bf7bfbc158bfb87150056d28c7a8688b642ef`

- `MetaMorpho`
- `MetaMorphoFactory`
- `PublicAllocator`
- `TestingMetaMorpho` ⭐ (Custom modification)
- `TestingMetaMorphoFactory` ⭐ (Custom modification)

**Custom Testing Contracts:**
- `TestingMetaMorpho`: MetaMorpho with timelock constraints disabled
- `TestingMetaMorphoFactory`: Factory for creating TestingMetaMorpho vaults
- These are only deployable on test networks (chainId 31337 or 31611)

## Solidity Contracts: Aerodrome

### From [aerodrome-finance/contracts](https://github.com/aerodrome-finance/contracts)

Commit: `a5fae2e87e490d6b10f133e28cc11bcc58c5346a`

- `Aero`
- `Minter`
- `PoolFactory`
- `Router`
- `VotingEscrow`
- `GaugeFactory`
- `Pool`
- `RewardsDistributor`
- `Voter`

## Solidity Contracts: Aerodrome Slipstream (Concentrated Liquidity)

### From [aerodrome-finance/slipstream](https://github.com/aerodrome-finance/slipstream)

Commit: `b98fc8175a54dedf556ed4dc3313eaab683597e3`

Aerodrome Slipstream is a concentrated liquidity AMM (adapted from Uniswap V3) for the Aerodrome/Velodrome ecosystem on Base. Uses Solidity `=0.7.6` (differs from other domains which use `^0.8.x`).

**Core** — Pool and factory contracts:
- `CLPool` — Concentrated liquidity pool implementation
- `CLFactory` — Pool factory with fee module support
- `CustomSwapFeeModule`, `CustomUnstakedFeeModule`, `DynamicSwapFeeModule` — Fee modules
- Interfaces: `ICLPool`, `ICLFactory`, `IVoter`, `IVotingEscrow`, callbacks, pool sub-interfaces
- Libraries: `TickMath`, `SqrtPriceMath`, `Oracle`, `Tick`, `TickBitmap`, `FullMath`, `Position`, etc.

**Periphery** — User-facing contracts:
- `NonfungiblePositionManager` — NFT-based liquidity position management
- `SwapRouter` — Swap routing
- `NonfungibleTokenPositionDescriptor` — On-chain NFT metadata/SVG generation
- `SugarHelper` — Utility helper
- Base classes: `ERC721Permit`, `LiquidityManagement`, `Multicall`, `PeripheryPayments`, `SelfPermit`, etc.
- Lens contracts: `Quoter`, `QuoterV2`, `MixedRouteQuoterV1`, `MixedRouteQuoterV2`, `TickLens`
- Libraries: `NFTDescriptor`, `NFTSVG`, `LiquidityAmounts`, `OracleLibrary`, `Path`, `PoolAddress`, etc.

**Gauge** — Liquidity mining/rewards:
- `CLGauge` — Concentrated liquidity gauge for reward distribution
- `CLGaugeFactory` — Gauge factory
- `Redistributor` — Fee redistribution

**Vendored Dependencies** (in `vendor/` directory):
- OpenZeppelin Contracts v3.4.2-solc-0.7 (ERC721, Ownable, ReentrancyGuard, Clones, etc.)
- ExcessivelySafeCall (nomad-xyz)
- SafeERC20Namer (Uniswap)
- base64 (Brechtpd)

## Package Structure

```
domains/
├── morpho/
│   └── contracts/
│       ├── Morpho.sol
│       ├── AdaptiveCurveIrm.sol
│       ├── MetaMorpho.sol
│       ├── TestingMetaMorpho.sol (custom)
│       ├── TestingMetaMorphoFactory.sol (custom)
│       ├── PublicAllocator.sol
│       ├── interfaces/
│       └── libraries/
├── aerodrome/
│   └── contracts/
│       ├── Router.sol
│       ├── Pool.sol
│       ├── PoolFactory.sol
│       └── ...
├── aerodrome-slipstream/
│   ├── contracts/
│   │   ├── core/        (CLPool, CLFactory, fees, interfaces, libraries)
│   │   ├── periphery/   (NonfungiblePositionManager, SwapRouter, base, lens, libraries)
│   │   ├── gauge/       (CLGauge, CLGaugeFactory, Redistributor)
│   │   └── libraries/   (EnumerableSet, ProtocolTimeLibrary)
│   └── vendor/
│       ├── openzeppelin/ (OZ v3.4.2-solc-0.7)
│       ├── nomad-xyz/    (ExcessivelySafeCall)
│       ├── uniswap/      (SafeERC20Namer)
│       └── base64-sol/   (base64)
└── test-utils/
    └── contracts/
        └── (test utility contracts)
```

## Migration from v1.x

**v1.x** exported compiled TypeScript/JSON artifacts with bytecode and ABIs.
**v2.x** exports Solidity source files (`.sol`) for compilation by your build system.

This enables:
- ✅ Contract verification on block explorers
- ✅ Smaller package size
- ✅ Standard Solidity import patterns
- ✅ No TypeScript build pipeline required
