Skip to content

Migration

The XPower protocol evolved from v9.x (Hardhat-based) to v10.x (Foundry-based) contracts. The migration system enables holders of legacy tokens and NFTs to transition to the current protocol.

Why Migration?

The v10.x rewrite introduced:

  • Foundry build system — faster compilation and testing
  • Optimized gas usage — ReentrancyGuardTransient (EIP-1153) instead of standard guards
  • Improved architecture — cleaner inheritance, better library separation
  • Additional features — Banq anti-gaming, integrator smoothing, dynamic rates

Migration preserves the economic continuity of the protocol while enabling technical progress.

Token Migration (XPOW)

Legacy XPOW holders migrate via the MoeMigratable system:

  1. Approve the legacy contract to spend your old XPOW
  2. Call migrateFrom(amount) on the new XPower contract
  3. Old XPOW is burned, new XPOW is minted 1:1
  4. The treasury split is maintained — legacy treasury balance migrates to the new MoeTreasury

Deadline

Migration must be completed within ~4 years (126,230,400 seconds) of the new contract deployment. After the deadline, migration is permanently sealed — the moeMigratable.seal() function is one-way and irreversible.

NFT Migration (XPowerNft)

Legacy XPowerNft holders use a two-step process:

  1. Burn old NFTs — Call migrateFromOld(ids, amounts) on the new contract, which burns the specified legacy NFTs
  2. Deposit mint — Call migrateDeposit(level, amount) to mint new XPowerNfts with the equivalent XPOW value

The NftMigratable contract manages the migration window and provides:

  • Sealing — Admin can permanently close migration
  • Emigration — Admin can open a 1-week window for the reverse direction (new → old)

APOW Migration

Legacy APOW holders use atomic migration via the SovMigratable system:

  1. Call migrateFrom(amount) on the new APower contract
  2. Old APOW is burned and new APOW is minted atomically
  3. The entire operation succeeds or reverts as a unit — no partial migration

The SovMigratable also supports cross-migration with the Banq lending system, enabling APOW to function as collateral.

Migration States

StateTokenNFT
OpenMigration activeMigration active
SealedPermanently closedNo new NFT migration
Emigration openN/A1-week reverse window
Deadline passedSealed automaticallySealed automatically

Current Deadlines

Check on-chain for exact deadlines:

moeMigratable.migrationDeadline()
nftMigratable.migrationDeadline()
sovMigratable.migrationDeadline()

See Contract Addresses for deployed contract addresses on mainnet and testnet.