Skip to content

Upgrade MOVE to OFT - #1298

Merged
0xmovses merged 18 commits into
mainfrom
upgrade-move-oft
Sep 3, 2025
Merged

Upgrade MOVE to OFT#1298
0xmovses merged 18 commits into
mainfrom
upgrade-move-oft

Conversation

@Primata

@Primata Primata commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

Summary

  • RFCs: $\emptyset$.
  • Categories: protocol-units,scripts.

Upgrades MOVE token to inherit OFTUpgradeable and become a native OFT.
It also:

  • grants DEFAULT_ADMIN_ROLE to Movement Labs Operations multisig
  • revokes DEFAULT_ADMIN_ROLE from old Movement Foundation multisig
  • burns the current bridge balance

Changelog

  • MOVETokenV2.sol
  • MOVETokenV2.t.sol

Testing

cd protocol-units/settlement/mcr/contracts
forge test ./test/token/MOVETokenV2.t.sol --rpc-url $ETHEREUM_MAINNET_RPC -vvv

Outstanding issues

Full upgrade procedure

Copilot AI review requested due to automatic review settings August 20, 2025 20:11
@Primata Primata changed the title Upgrade move oft Upgrade MOVE to OFT Aug 20, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the MOVE token to inherit from OFTUpgradeable and adds native OFT (Omnichain Fungible Token) capabilities for cross-chain functionality. The upgrade also includes significant access control changes by transferring admin roles from the old Movement Foundation multisig to Movement Labs Operations multisig and burning bridge balances.

Key changes:

  • Implements MOVETokenV2 with LayerZero OFT capabilities for cross-chain transfers
  • Updates access control by granting DEFAULT_ADMIN_ROLE to Movement Labs and revoking it from old Foundation
  • Burns deprecated bridge balances during upgrade initialization
  • Adds comprehensive test coverage for the upgrade process and OFT functionality

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
MOVETokenV2.sol New implementation inheriting from MOVEToken and OFTUpgradeable with upgrade initialization
MOVEToken.sol Makes decimals() function virtual to support inheritance
MOVETokenV2.t.sol Comprehensive test suite covering upgrade process, OFT features, and LayerZero integration
Various test files New test files for token components (base, custodian, locked tokens, staking)
Configuration files Updated deployment addresses and build settings
Git submodules Added LayerZero and devtools dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread protocol-units/settlement/mcr/contracts/src/token/MOVETokenV2.sol
Comment thread protocol-units/settlement/mcr/contracts/src/token/MOVETokenV2.sol
Comment thread protocol-units/settlement/mcr/contracts/foundry.toml
@@ -1,5 +1,5 @@
{
"minDelay": "172800",
"minDelay": 172800,

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The minDelay value changed from a string "172800" to a number 172800. While this works functionally, ensure all consuming code properly handles both string and numeric formats to avoid parsing errors.

Suggested change
"minDelay": 172800,
"minDelay": "172800",

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this with respect to the recent string vs value "update"?

@apenzk

apenzk commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

This PR combines large changes that have nothing to do with the current MOVE token upgrade to V2. Hence the description of this PR is incomplete.

In particular the description does not describe, why there are many changes and indeed creations of files related to the current MoveToken. ( I take it that you forked of another branch, or copied in files from another branch ).

I suggest to split this into two PRs.

  1. PR to get the current code to the correct state with respect to the move token deployment. (which we then can approve first). I assume this has to be correct, even if we would not have applied PR2
  2. PR for upgrading to V2 (rebase)

@Primata

Primata commented Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

This PR combines large changes that have nothing to do with the current MOVE token upgrade to V2. Hence the description of this PR is incomplete.

In particular the description does not describe, why there are many changes and indeed creations of files related to the current MoveToken. ( I take it that you forked of another branch, or copied in files from another branch ).

I suggest to split this into two PRs.

  1. PR to get the current code to the correct state with respect to the move token deployment. (which we then can approve first). I assume this has to be correct, even if we would not have applied PR2

  2. PR for upgrading to V2 (rebase)

#1285 it's already here

@0xmovses 0xmovses left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to run the tests, perhaps a step is missing?

⋊> ~/m/movement on upgrade-move-oft ◦ cd protocol-units/settlement/mcr/contracts                                                                                                   15:16:36
⋊> ~/m/m/p/s/m/contracts on upgrade-move-oft ◦ forge test ./test/token/MOVETokenV2.t.sol --rpc-url $ETHEREUM_MAINNET_RPC -vvv                                                      15:16:42
error: unexpected argument './test/token/MOVETokenV2.t.sol' found

Usage: forge test [OPTIONS]

For more information, try '--help'

@Primata

Primata commented Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

Unable to run the tests, perhaps a step is missing?

⋊> ~/m/movement on upgrade-move-oft ◦ cd protocol-units/settlement/mcr/contracts                                                                                                   15:16:36
⋊> ~/m/m/p/s/m/contracts on upgrade-move-oft ◦ forge test ./test/token/MOVETokenV2.t.sol --rpc-url $ETHEREUM_MAINNET_RPC -vvv                                                      15:16:42
error: unexpected argument './test/token/MOVETokenV2.t.sol' found

Usage: forge test [OPTIONS]

For more information, try '--help'

No, that's correct, can you try running the MOVETokenV2 test by yourself? You can do it a few ways

@0xmovses

Copy link
Copy Markdown
Contributor

CMD in the PR description should result in a successful test. You can either update the cmds or fix whatever is wrong. Thanks!

@0xmovses

Copy link
Copy Markdown
Contributor

Not sure what's happening here, I just pulled latest and ran forge test ./test/token/MOVETokenV2.t.sol --rpc-url $ETHEREUM_MAINNET_RPC -vvv

⋊> ~/m/m/p/s/m/contracts on upgrade-move-oft ◦ forge test ./test/token/MOVETokenV2.t.sol --rpc-url $ETHEREUM_MAINNET_RPC -vvv                                                      20:53:41


error: unexpected argument './test/token/MOVETokenV2.t.sol' found

Usage: forge test [OPTIONS]

For more information, try '--help'.

Can you fix the cmd so I'm able to run the tests?

@0xmovses
0xmovses self-requested a review August 26, 2025 15:43
@0xmovses
0xmovses self-requested a review August 26, 2025 15:59
@Primata
Primata removed the request for review from ganymedio August 27, 2025 16:37
@0xmovses

Copy link
Copy Markdown
Contributor

This now has many merge conflicts @Primata

@apenzk
apenzk requested review from 0xmovses and apenzk September 2, 2025 17:48

@apenzk apenzk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MOVETokenV2.t.sol looks great with the comments and seems easy accessible. All tests work.

Comment thread protocol-units/settlement/mcr/contracts/src/token/MOVETokenV2.sol

@0xmovses 0xmovses left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@0xmovses
0xmovses merged commit 5eb6154 into main Sep 3, 2025
39 of 47 checks passed
* @param _revoke The address of the address to revoke role.
* @param _burned Burns circulation supply on Ethereum.
*/
function initialize(address _delegate, address _revoke, address[] calldata _burned) external reinitializer(2) {

@Primata Primata Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_delegate is movement labs operations multisig
_revoke is movement foundation multisig

function initialize(address _delegate, address _revoke, address[] calldata _burned) external reinitializer(2) {
__OFTCore_init(_delegate);
__Ownable_init_unchained(_delegate);
_grantRole(DEFAULT_ADMIN_ROLE, _delegate);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

movement labs ops receives DEFAULT_ADMIN_ROLE

__OFTCore_init(_delegate);
__Ownable_init_unchained(_delegate);
_grantRole(DEFAULT_ADMIN_ROLE, _delegate);
_revokeRole(DEFAULT_ADMIN_ROLE, _revoke);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous movement foundation multisig had the DEFAULT_ADMIN_ROLE, here we intend to revoke it.

_grantRole(DEFAULT_ADMIN_ROLE, _delegate);
_revokeRole(DEFAULT_ADMIN_ROLE, _revoke);
for (uint256 i = 0; i < _burned.length; i++) {
_burn(_burned[i], balanceOf(_burned[i]));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specific addresses like the old bridge contract and liquidity meant to be released on the Movement side to initial validator rewards get their supply burned.

/**
* @dev Disables potential implementation exploit
*/
constructor(address _endpoint) OFTUpgradeable(_endpoint) {_disableInitializers();}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endpoint is defined in the implementation. Any new upgrade would need the new implementation to once again specify the endpoint.

import {MOVEToken} from "./MOVEToken.sol";
import {OFTUpgradeable, ERC20Upgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol";

contract MOVETokenV2 is MOVEToken, OFTUpgradeable {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we inherit from MOVEToken to avoid collision.

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.

4 participants