Skip to content

feat: migrate USDat from M-backed JMIExtension to PYUSDX MultiMint #1

Open
PierrickGT wants to merge 3 commits into
v2from
proto-963-migrate-usdat-code-to-pyusdx
Open

feat: migrate USDat from M-backed JMIExtension to PYUSDX MultiMint #1
PierrickGT wants to merge 3 commits into
v2from
proto-963-migrate-usdat-code-to-pyusdx

Conversation

@PierrickGT

@PierrickGT PierrickGT commented Jun 10, 2026

Copy link
Copy Markdown
Member

chore(lib): replace lib/m-extensions by lib/PYUSDX

feat: migrate USDat from M-backed JMIExtension to PYUSDX MultiMint
Re-point the USDat implementation at the PYUSDX MultiMint base and add the upgrade-only migration path:

  • USDat extends MultiMint/ForcedTransferable, exposes migrate (reinitializer) instead of initialize; production is upgrade-only behind the existing proxy
  • UpgradeUSDatBase: claim outstanding M yield (permissionless) then upgrade + migrate, registering held M as a replaceable alt-asset; drop the JMIExtension storage-layout reference (skipped) and allow the missing initializer
  • Reorganize interfaces under src/interfaces/ (IUSDat, IMTokenLike + isEarning)
  • foundry.toml: enable ast/build_info/storageLayout for OZ upgrade validation
  • Tests: PYUSDX swapIn/swapOut unit suite (wrap/unwrap, whitelist, freeze, pause, forced transfer, migrate, replaceAsset) and a mainnet-fork upgrade test asserting state, holder balances, role continuity, and M earning stop

chore: drop unused solady and top-level OZ submodules

Related PRs:

Re-point the USDat implementation at the PYUSDX MultiMint base and add the
upgrade-only migration path:

- USDat extends MultiMint/ForcedTransferable, exposes `migrate` (reinitializer)
  instead of `initialize`; production is upgrade-only behind the existing proxy
- UpgradeUSDatBase: claim outstanding M yield (permissionless) then upgrade +
  migrate, registering held M as a replaceable alt-asset; drop the JMIExtension
  storage-layout reference (skipped) and allow the missing initializer
- Reorganize interfaces under src/interfaces/ (IUSDat, IMTokenLike + isEarning)
- foundry.toml: enable ast/build_info/storageLayout for OZ upgrade validation
- Tests: PYUSDX swapIn/swapOut unit suite (wrap/unwrap, whitelist, freeze,
  pause, forced transfer, migrate, replaceAsset) and a mainnet-fork upgrade
  test asserting state, holder balances, role continuity, and M earning stop
- Remove lib/solady: vestigial from the M-extensions era; nothing in the
  compiled tree imports it (verified the build passes without it).
- Remove lib/openzeppelin-contracts-upgradeable: OpenZeppelin is already
  vendored by PYUSDX (common/lib). Remap @OpenZeppelin and
  openzeppelin-contracts(-upgradeable) into PYUSDX's copies so our imports
  resolve to the same OZ the USDat inheritance chain (MultiMint -> Extension)
  already uses (upgradeable v5.3.0, contracts v5.5.0).
- Update .gitmodules and foundry.lock accordingly.

Full suite (54 unit + 4 fork) green against the PYUSDX-provided OZ.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant