Skip to content
Back to skills

Crane Morpho

ASecurity

This skill should be used when the user asks about "Crane Morpho", "MorphoBlueService", "TestBase_MorphoBlue", "Morpho port", "Morpho fork parity", "FOUNDRY_PROFILE=morpho_port", "MorphoBlueAwareRepo", integrating Morpho into a Diamond/strategy, or writing Foundry tests against Crane's Morpho port.

  • 9 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
testingtestingapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 10, 2026

npx -y skills add cyotee/indexedex --skill crane-morpho --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Crane Morpho?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Crane Morpho
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cyotee-crane-morpho/badge)](https://www.skillsdirectory.com/skills/cyotee-crane-morpho)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: crane-morpho
description: This skill should be used when the user asks about "Crane Morpho", "MorphoBlueService", "TestBase_MorphoBlue", "Morpho port", "Morpho fork parity", "FOUNDRY_PROFILE=morpho_port", "MorphoBlueAwareRepo", integrating Morpho into a Diamond/strategy, or writing Foundry tests against Crane's Morpho port.
license: MIT
---

# Crane Morpho Integration

How to **build on** and **test** Morpho using Crane’s port (not how Morpho works in general — see architecture/ops skills).

## Layout

| Layer | Path |
|-------|------|
| Domain | `contracts/external/morpho/{blue,blue-irm,blue-oracles,metamorpho-v1.1,public-allocator,vault-v2,bundler3}/` |
| Wrappers | `contracts/protocols/lending/morpho/{blue,metamorpho,vault-v2,bundler}/` |
| Hermetic tests | `test/foundry/spec/protocols/lending/morpho/` |
| Fork tests | `test/foundry/fork/{ethereum_main,base_main}/morpho/` |
| Constants | `contracts/constants/networks/*` |

Each domain package has `VENDOR.md` (pin + license + adaptations).

## Quick start: strategy / Diamond

```solidity
import {MorphoBlueAwareRepo} from
    "@crane/contracts/protocols/lending/morpho/blue/aware/MorphoBlueAwareRepo.sol";
import {MorphoBlueService} from
    "@crane/contracts/protocols/lending/morpho/blue/services/MorphoBlueService.sol";
import {IMorpho, MarketParams} from
    "@crane/contracts/external/morpho/blue/interfaces/IMorpho.sol";

// init (once)
MorphoBlueAwareRepo._initialize(morpho, irm, oracleFactory);

// ops — tokens must sit on this contract
IMorpho m = MorphoBlueAwareRepo._morpho();
MorphoBlueService._supply(m, marketParams, amount, address(this));
MorphoBlueService._supplyCollateral(m, marketParams, coll, address(this));
MorphoBlueService._borrow(m, marketParams, debt, address(this), address(this));
```

**Service = library context of caller.** Do not `vm.prank(user)` + Service unless the user is the contract holding inventory.

## Testing ladder

| Layer | Command / base |
|-------|----------------|
| Domain compile | `FOUNDRY_PROFILE=morpho_port forge build` |
| Blue upstream | `forge test --match-path '…/morpho/blue/upstream/**'` |
| Crane hermetic | `TestBase_MorphoBlue`, `TestBase_MetaMorpho` |
| Fork parity | `MorphoBluePortedMarketParity_Fork` ETH + Base |
| Profile | Always set `FOUNDRY_PROFILE=morpho_port` for Morpho work |

Default monorepo profile **skips** `contracts/external/**` — Morpho still compiles when tests import it, but path-scoped Morpho CI should use `morpho_port`.

## Production-first rules

- Never `vm.mockCall` Morpho/MetaMorpho SUT.
- Hermetic: `new Morpho` / factory / IRM from vendored sources.
- Fork: bind `ETHEREUM_MAIN.MORPHO` / `BASE_MAIN.MORPHO`; parity uses **second local Morpho**.
- Exact deltas / share equality — not “balance increased”.

## Navigation

| Topic | File |
|-------|------|
| Service + Aware API | `references/service-and-aware.md` |
| TestBase inheritance | `references/testbases.md` |
| Fork parity recipe | `references/fork-parity.md` |
| Commands checklist | `references/commands.md` |
| Protocol meaning | `skill:morpho-architecture` |
| User ops | `skill:morpho-blue-operations`, `skill:morpho-vaults` |

## Key files

- `MorphoBlueService.sol`, `MorphoBlueAwareRepo.sol`, `Behavior_IMorpho.sol`
- `TestBase_MorphoBlue.sol`, `TestBase_MetaMorpho.sol`
- `MorphoBluePortedMarketParity_Fork.t.sol` (ETH + Base)
- Plan: `docs/superpowers/plans/2026-07-27-morpho-port.md`

## See also

- `skill:crane-testing`, `skill:crane-porting`, `skill:crane-porting-verification`
- `skill:crane-architecture` (AwareRepo / Service patterns)

Files in this skill

  • SKILL.md3.5 KB
  • references/commands.md933 B
  • references/fork-parity.md1.2 KB
  • references/service-and-aware.md1.1 KB
  • references/testbases.md981 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…