-
Notifications
You must be signed in to change notification settings - Fork 110
Upgrade MOVE to OFT #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade MOVE to OFT #1298
Changes from all commits
3a3ba71
7e90e3a
ba58a46
5b2aab9
45f2cbc
1307515
b992010
24dd3d0
1d01e5b
6e4fd85
dff6ebf
0539834
95aac13
13bcf88
33c15a4
9866556
5f601d2
7270a12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.26; | ||
|
|
||
| import {MOVEToken} from "./MOVEToken.sol"; | ||
| import {OFTUpgradeable, ERC20Upgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol"; | ||
|
|
||
| contract MOVETokenV2 is MOVEToken, OFTUpgradeable { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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();} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _delegate is movement labs operations multisig |
||
| __OFTCore_init(_delegate); | ||
| __Ownable_init_unchained(_delegate); | ||
| _grantRole(DEFAULT_ADMIN_ROLE, _delegate); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. movement labs ops receives DEFAULT_ADMIN_ROLE |
||
| _revokeRole(DEFAULT_ADMIN_ROLE, _revoke); | ||
|
Primata marked this conversation as resolved.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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])); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.