Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
url = https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
[submodule "protocol-units/settlement/mcr/contracts/lib/v2-periphery"]
path = protocol-units/settlement/mcr/contracts/lib/v2-periphery
url = https://github.com/Uniswap/v2-periphery
url = https://github.com/Uniswap/v2-periphery
[submodule "protocol-units/settlement/mcr/contracts/lib/devtools"]
path = protocol-units/settlement/mcr/contracts/lib/devtools
url = https://github.com/layerzero-labs/devtools
[submodule "protocol-units/settlement/mcr/contracts/lib/LayerZero-v2"]
path = protocol-units/settlement/mcr/contracts/lib/LayerZero-v2
url = https://github.com/layerzero-labs/LayerZero-v2
[submodule "protocol-units/settlement/mcr/contracts/lib/solidity-bytes-utils"]
path = protocol-units/settlement/mcr/contracts/lib/solidity-bytes-utils
url = https://github.com/GNSPS/solidity-bytes-utils.git
26 changes: 26 additions & 0 deletions protocol-units/settlement/mcr/contracts/foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"lib/v2-periphery": {
"rev": "0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f"
},
"lib/safe-smart-account": {
"rev": "bf943f80fec5ac647159d26161446ac5d716a294"
},
"lib/openzeppelin-contracts": {
"rev": "dbb6104ce834628e473d2173bbc9d47f81a9eec3"
},
"lib/openzeppelin-contracts-upgradeable": {
"rev": "723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1"
},
"lib/forge-std": {
"rev": "1714bee72e286e73f76e320d110e0eaf5c4e649d"
},
"lib/openzeppelin-foundry-upgrades": {
"rev": "4cd15fc50b141c77d8cc9ff8efb44d00e841a299"
},
"lib/solmate": {
"rev": "97bdb2003b70382996a79a406813f76417b1cf90"
},
"lib/murky": {
"rev": "5feccd1253d7da820f7cccccdedf64471025455d"
}
}
1 change: 1 addition & 0 deletions protocol-units/settlement/mcr/contracts/lib/LayerZero-v2
Submodule LayerZero-v2 added at 63bbd3
1 change: 1 addition & 0 deletions protocol-units/settlement/mcr/contracts/lib/devtools
Submodule devtools added at f82940
8 changes: 8 additions & 0 deletions protocol-units/settlement/mcr/contracts/remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ openzeppelin/=lib/createx/lib/openzeppelin-contracts/contracts/
@safe-smart-account/=lib/safe-smart-account/
solady/=lib/createx/lib/solady/
solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/
@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/
@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/
@layerzerolabs/oapp-evm-upgradeable/=lib/devtools/packages/oapp-evm-upgradeable/
@layerzerolabs/oft-evm-upgradeable/=lib/devtools/packages/oft-evm-upgradeable/
@layerzerolabs/test-devtools-evm-foundry/=lib/devtools/packages/test-devtools-evm-foundry/
@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/protocol/
@layerzerolabs/lz-evm-messagelib-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/messagelib/
solidity-bytes-utils/=lib/solidity-bytes-utils/
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import {MOVEToken} from "../src/token/MOVEToken.sol";
import {MOVETokenV2} from "../src/token/MOVETokenV2.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { Helper, ProxyAdmin } from "./helpers/Helper.sol";
import {ICREATE3Factory} from "./helpers/Create3/ICREATE3Factory.sol";
Expand Down Expand Up @@ -72,8 +73,14 @@ contract MOVETokenDeployer is Helper {

function _upgradeMove() internal {
console.log("MOVE: upgrading");
MOVEToken newMoveImplementation = new MOVEToken();
address layerzeroEndpoint = block.chainid == 1 ?
0x1a44076050125825900e736c501f859c50fE728c : // Mainnet
0x6EDCE65403992e310A62460808c4b910D972f10f; // BSC Testnet
MOVEToken newMoveImplementation = new MOVETokenV2(layerzeroEndpoint);
_checkBytecodeDifference(address(newMoveImplementation), deployment.move);

// bridge address
address[1] memory burn = [0xf1dF43A3053cd18E477233B59a25fC483C2cBe0f];
// Prepare the data for the upgrade
bytes memory data = abi.encodeWithSignature(
"schedule(address,uint256,bytes,bytes32,bytes32,uint256)",
Expand All @@ -83,13 +90,19 @@ contract MOVETokenDeployer is Helper {
"upgradeAndCall(address,address,bytes)",
address(deployment.move),
address(newMoveImplementation),
""
abi.encodeWithSignature(
"initialize(address,address,address[])",
deployment.movementLabsSafe,
0x074C155f09cE5fC3B65b4a9Bbb01739459C7AD63, // remove old foundation
burn
)
),
bytes32(0),
bytes32(0),
config.minDelay
);

// Data to be used to propose the upgrade
_proposeUpgrade(data, "movetoken.json");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract MOVEToken is ERC20PermitUpgradeable, AccessControlUpgradeable {
* @dev Returns the number of decimals
* @notice decimals is set to 8, following the Movement network standard decimals
*/
function decimals() public pure override returns (uint8) {
function decimals() public pure virtual override returns (uint8) {
return 8;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
Comment thread
Primata marked this conversation as resolved.

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.


/**
* @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.


/**
* @dev Initializes the contract with initial parameters.
* @param _delegate The address of the delegate.
* @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

__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

_revokeRole(DEFAULT_ADMIN_ROLE, _revoke);
Comment thread
Primata marked this conversation as resolved.

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.

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 Returns the number of decimals
* @notice decimals is set to 8, following the Movement network standard decimals
*/
function decimals() public pure override(ERC20Upgradeable, MOVEToken) returns (uint8) {
return 8;
}
}
Loading
Loading