Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wMORPHO

Solidity Foundry License: MIT

Two composable primitives around Morpho:

  1. WMORPHO — a liquid, transferable wrapper for the (originally non-transferable) MORPHO token.
  2. Omnipool — an ERC4626 meta-allocator that spreads one asset across several MetaMorpho vaults, inspired by Conic Finance.

Update (2026). When this was built (mid-2024) the MORPHO token was non-transferable — holders could accrue rewards but not move the token. Morpho only shipped its own official "Wrapped MORPHO" in November 2024. WMORPHO here anticipated that move: wrap the illiquid token into a freely-transferable receipt while the underlying stays escrowed, and let claimed rewards accrue to holders.

WMORPHO

An ERC4626 receipt over MORPHO:

  • Wrap 1:1. wrap(amount) escrows MORPHO and mints transferable wMORPHO.
  • Rewards accrue to holders. claimRewards(claimable, proof) pulls MORPHO rewards from the distributor into the wrapper; the extra MORPHO raises the share price, so every holder's wMORPHO appreciates (wstETH-style, no per-user bookkeeping).
  • Gated redemption. Unwrapping to the underlying is disabled until enableTransfers() is called — mirroring MORPHO's own non-transferability, the wrapped token trades even while the underlying cannot yet leave the wrapper.
  • Inflation-attack resistant via OpenZeppelin's virtual-shares ERC4626.

Omnipool

An ERC4626 vault that allocates a single underlying across multiple ERC4626 child vaults (e.g. MetaMorpho) by governance-set weights:

  • One deposit, diversified. Depositors get one receipt share for the whole basket; deposits are routed across children by target weight, withdrawals pull them back.
  • Weights & rebalancing. Weights sum to ONE (1e18); rebalance() shuffles funds toward targets net-neutrally (totalWithdrawn == totalSupplied), also deploying idle.
  • Reward integral. Multiple incentive tokens are distributed to shareholders via an accRewardPerShare integral, checkpointed on every transfer so the share token stays freely transferable while staying reward-exact.
  • Curated & timelocked. Roles (owner / curator / allocator / guardian); enabling a vault or loosening a cap is timelocked and can be vetoed by the guardian, while de-risking (tightening a cap, removing an emptied vault) is instant.
  • Safety. Per-vault caps, an idle buffer for cheap small withdrawals, reentrancy guards, and OpenZeppelin virtual shares against inflation/donation attacks.

Repository layout

src/
├── Omnipool.sol      ERC4626 meta-allocator over child vaults
├── WMORPHO.sol       liquid MORPHO wrapper
└── interfaces.sol    external interfaces (rewards distributor, MetaMorpho)
script/Deploy.s.sol   deployment script
test/
├── Omnipool.t.sol    omnipool unit tests
├── WMORPHO.t.sol     wrapper unit tests
├── Integration.t.sol end-to-end scenarios
└── utils/            mock ERC20, mock ERC4626 vault, mock distributor

Build & test

Requires Foundry.

git clone --recurse-submodules <repo-url>
cd wMORPHO
forge build
forge test

The suite is fully self-contained (mock collateral, mock vaults, mock distributor) and runs in CI without any RPC or secrets.

Security

See SECURITY.md. This is research-stage, unaudited code; external audits are planned before any production use.

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages