Skip to content

Feat/locker migration#74

Open
oxoxDev wants to merge 16 commits intomahaxyz:masterfrom
oxoxDev:feat/locker-migration
Open

Feat/locker migration#74
oxoxDev wants to merge 16 commits intomahaxyz:masterfrom
oxoxDev:feat/locker-migration

Conversation

@oxoxDev
Copy link
Copy Markdown

@oxoxDev oxoxDev commented Aug 8, 2025

Locker Migration Implementation

Overview

This PR implements a migration system to transfer existing locker tokens from the old contract to the new BaseLocker implementation while preserving all lock details and ownership.

Key Changes

Migration Logic (BaseLocker.sol)

  • Added migrateLock() and migrateLocks() functions
  • no MAHA transfer needed
  • Preserves:
    • Amount
    • Start/end times
    • Power
    • Ownership

Deployment (deploy-migrate.ts)

  • Deploys LockerToken-V3 and OmnichainStakingToken-V3
  • Proper initialization and contract linking

Migration Data (locker-snapshot.csv)

  • 1,109 tokens with complete lock data
  • Fields:
    • token
    • amount
    • start
    • end
    • owner
    • stakednft

Migration Script (migrate-locker.ts)

  • Reads from CSV for efficiency
  • Batch processing (100 tokens/batch)
  • Handles both staked/unstaked tokens correctly

Testing (LockerMigrationTest.sol)

  • Fork test with Base mainnet data
  • Validates:
    • Amount
    • Start/end times
    • Power
    • Ownership

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