Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ contract MOVETokenDeployer is Helper {
// if move is already deployed, upgrade it
_upgradeMove() : revert("MOVE: both admin and proxy should be registered");

require(MOVEToken(deployment.move).balanceOf(address(deployment.movementAnchorage)) == 999999998000000000, "Movement Anchorage Safe balance is wrong");
require(MOVEToken(deployment.move).decimals() == 8, "Decimals are expected to be 8");
require(MOVEToken(deployment.move).totalSupply() == 1000000000000000000,"Total supply is wrong");
require(MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(deployment.movementFoundationSafe)),"Movement Foundation expected to have token admin role");
require(!MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(deployment.movementLabsSafe)),"Movement Labs not expected to have token admin role");
require(!MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(timelock)),"Timelock not expected to have token admin role");
vm.stopBroadcast();

if (vm.isContext(VmSafe.ForgeContext.ScriptBroadcast)) {
Expand All @@ -69,6 +63,13 @@ contract MOVETokenDeployer is Helper {
console.log("proxy", address(moveProxy));
deployment.move = address(moveProxy);
deployment.moveAdmin = _storeAdminDeployment();

require(MOVEToken(deployment.move).balanceOf(address(deployment.movementAnchorage)) == 999999998000000000, "Movement Anchorage Safe balance is wrong");
require(MOVEToken(deployment.move).decimals() == 8, "Decimals are expected to be 8");
require(MOVEToken(deployment.move).totalSupply() == 1000000000000000000,"Total supply is wrong");
require(MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(deployment.movementFoundationSafe)),"Movement Foundation expected to have token admin role");
require(!MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(deployment.movementLabsSafe)),"Movement Labs not expected to have token admin role");
require(!MOVEToken(deployment.move).hasRole(DEFAULT_ADMIN_ROLE, address(timelock)),"Timelock not expected to have token admin role");
}

function _upgradeMove() internal {
Expand Down Expand Up @@ -104,5 +105,8 @@ contract MOVETokenDeployer is Helper {

// Data to be used to propose the upgrade
_proposeUpgrade(data, "movetoken.json");

// We cannot require changes since they will only happen once the timelock executes the upgrade
// Refer to test section that allows us to verify if after upgrade Token will have correct values
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import {ERC20PermitUpgradeable} from
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
import {OFTUpgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol";

contract MOVETokenHyperliquid is ERC20PermitUpgradeable, OFTUpgradeable {

/// keccak256("HyperCore deployer")
bytes32 internal constant FINALIZER_SLOT = 0x8c306a6a12fff1951878e8621be6674add1102cd359dd968efbbe797629ef84f;

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

/**
* @dev Initializes the contract with initial parameters.
* @param _delegate The address of the delegate.
*/
function initialize(address _delegate) external initializer {
__OFT_init("Movement", "MOVE", _delegate);
__EIP712_init_unchained("Movement", "1");
__Ownable_init_unchained(_delegate);
_setFinalizer(_delegate);
}

/**
* @dev Returns the number of decimals
* @notice decimals is set to 8, following the Movement network standard decimals
*/
function decimals() public pure virtual override returns (uint8) {
return 8;
}

/**
* @dev Sets the finalizer address.
* @param _finalizer The address of the finalizer.
*/
function setFinalizer(address _finalizer) external onlyOwner {
_setFinalizer(_finalizer);
}

function _setFinalizer(address _finalizer) internal {
assembly {
sstore(FINALIZER_SLOT, _finalizer)
}
}
}
32 changes: 32 additions & 0 deletions protocol-units/settlement/mcr/contracts/src/token/MOVETokenL2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import {ERC20PermitUpgradeable} from
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
import {OFTUpgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol";

contract MOVETokenL2 is ERC20PermitUpgradeable, OFTUpgradeable {

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

/**
* @dev Initializes the contract with initial parameters.
* @param _delegate The address of the delegate.
*/
function initialize(address _delegate) external initializer {
__OFT_init("Movement", "MOVE", _delegate);
__EIP712_init_unchained("Movement", "1");
__Ownable_init_unchained(_delegate);
}

/**
* @dev Returns the number of decimals
* @notice decimals is set to 8, following the Movement network standard decimals
*/
function decimals() public pure virtual override returns (uint8) {
return 8;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {MOVEToken} from "./MOVEToken.sol";
import {OFTUpgradeable, ERC20Upgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol";

contract MOVETokenV2 is MOVEToken, OFTUpgradeable {

/**
* @dev Disables potential implementation exploit
*/
Expand All @@ -25,7 +24,6 @@ contract MOVETokenV2 is MOVEToken, OFTUpgradeable {
for (uint256 i = 0; i < _burned.length; i++) {
_burn(_burned[i], balanceOf(_burned[i]));
}

}

/**
Expand All @@ -35,4 +33,4 @@ contract MOVETokenV2 is MOVEToken, OFTUpgradeable {
function decimals() public pure override(ERC20Upgradeable, MOVEToken) returns (uint8) {
return 8;
}
}
}
Loading
Loading