-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(script): add dev deploy and config scripts #2
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3b53642
feat(script): add dev deploy scripts
PierrickGT d2c35b5
feat(script): add dev config scripts
PierrickGT aaa6bc7
chore(github): enable fork tests
PierrickGT 8122a97
fix(Portals): use relative importh paths
PierrickGT 0bd3e56
chore(lib): update dependencies
PierrickGT d421ecb
fix(DeployBase): fix SpokePortal address
PierrickGT 8418cdd
fix(Makefile): add verify flag to deploy commands
PierrickGT cc5c79c
feat(script): add transceivers upgrade script
PierrickGT faa8982
feat(script): add portal uggrade script
PierrickGT 2d36bb9
chore(lib): update dependencies
PierrickGT f23059e
feat(script): add HubPortal cast commands
PierrickGT 3b6ea4f
Merge branch 'main' into feat/WEB3-1200-add-deploy-scripts
PierrickGT f8d4238
feat(script): add SmartM token deploy script
PierrickGT e3bf133
chore(git): add build sizes workflow test
PierrickGT 779c8f9
Merge branch 'main' into feat/WEB3-1200-add-deploy-scripts
PierrickGT 4a02907
chore(lib): remove wrapped-m-token
PierrickGT ade50f2
feat(Deploy): add SpokeVault to deploy script
PierrickGT bbc24d0
feat(Governance): add Governor and Configurator contracts (#3)
PierrickGT 346c7f6
fix(SpokeVault): use Migratable from common
PierrickGT 74ba0f9
chore(lib): update common
PierrickGT 4130092
feat(Deploy): add Spoke SmartM Earner Manager
PierrickGT 3dd3dd7
Merge branch 'main' of github.com:m0-foundation/m-portal into feat/WE…
PierrickGT bfcd720
fix(SpokePortal): fix IndexingMath import path
PierrickGT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,35 @@ | ||
# name: Forge Fork Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# | ||
# permissions: write-all | ||
# | ||
# jobs: | ||
# check: | ||
# name: Fork Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: recursive | ||
# | ||
# - name: Setup Node | ||
# uses: actions/setup-node@v4 | ||
# | ||
# - name: Install NPM dependencies | ||
# run: npm install | ||
# | ||
# - name: Install Foundry | ||
# uses: foundry-rs/foundry-toolchain@v1 | ||
# | ||
# - name: Run Forge build | ||
# run: | | ||
# forge --version | ||
# make sizes | ||
# id: build | ||
# | ||
# - name: Run Forge fork tests | ||
# run: make fork profile=ci | ||
# env: | ||
# MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} | ||
# MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
# BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | ||
# OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | ||
name: Forge Fork Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
check: | ||
name: Fork Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install NPM dependencies | ||
run: npm install | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run Forge fork tests | ||
run: make fork profile=ci | ||
env: | ||
MNEMONIC: ${{ secrets.MNEMONIC_FOR_TESTS }} | ||
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | ||
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Forge Sizes Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
check: | ||
name: Sizes Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
make sizes | ||
id: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
[submodule "lib/common"] | ||
path = lib/common | ||
url = [email protected]:m0-foundation/common.git | ||
branch = main | ||
[submodule "lib/protocol"] | ||
path = lib/protocol | ||
url = [email protected]:m0-foundation/protocol.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule common
updated
43 files
Submodule example-native-token-transfers
updated
from 4148ba to 799cd4
Submodule protocol
updated
5 files
+9 −5 | src/MToken.sol | |
+10 −8 | src/abstract/ContinuousIndexing.sol | |
+5 −4 | src/interfaces/IContinuousIndexing.sol | |
+15 −0 | src/interfaces/IMToken.sol | |
+49 −15 | test/MToken.t.sol |
Submodule smart-m-token
updated
from 8eecb7 to 963457
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity 0.8.26; | ||
|
||
import { Script, console2 } from "../../lib/forge-std/src/Script.sol"; | ||
|
||
import { IManagerBase } from "../../lib/example-native-token-transfers/evm/src/interfaces/IManagerBase.sol"; | ||
|
||
import { IHubPortal } from "../../src/interfaces/IHubPortal.sol"; | ||
|
||
import { Utils } from "../helpers/Utils.sol"; | ||
|
||
contract CastBase is Script, Utils { | ||
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. I don't think it's should be called |
||
function _quoteDeliveryPrice( | ||
address hubPortal_, | ||
uint16 destinationChainId_ | ||
) internal view returns (uint256 deliveryPrice_) { | ||
(, deliveryPrice_) = IManagerBase(hubPortal_).quoteDeliveryPrice(destinationChainId_, new bytes(1)); | ||
} | ||
|
||
function _sendMTokenIndex( | ||
address hubPortal_, | ||
uint16 destinationChainId_, | ||
bytes32 refundAddress_, | ||
uint256 value_ | ||
) internal returns (bytes32 messageId_) { | ||
return | ||
IHubPortal(hubPortal_).sendMTokenIndex{ value: value_ }(destinationChainId_, refundAddress_, new bytes(1)); | ||
} | ||
|
||
function _sendRegistrarKey( | ||
address hubPortal_, | ||
uint16 destinationChainId_, | ||
bytes32 key_, | ||
bytes32 refundAddress_, | ||
uint256 value_ | ||
) internal returns (bytes32 messageId_) { | ||
return | ||
IHubPortal(hubPortal_).sendRegistrarKey{ value: value_ }( | ||
destinationChainId_, | ||
key_, | ||
refundAddress_, | ||
new bytes(1) | ||
); | ||
} | ||
|
||
function _sendRegistrarListStatus( | ||
address hubPortal_, | ||
uint16 destinationChainId_, | ||
bytes32 listName_, | ||
address account_, | ||
bytes32 refundAddress_, | ||
uint256 value_ | ||
) internal returns (bytes32 messageId_) { | ||
return | ||
IHubPortal(hubPortal_).sendRegistrarListStatus{ value: value_ }( | ||
destinationChainId_, | ||
listName_, | ||
account_, | ||
refundAddress_, | ||
new bytes(1) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity 0.8.26; | ||
|
||
import { console2 } from "../../../lib/forge-std/src/Script.sol"; | ||
|
||
import { CastBase } from "../CastBase.sol"; | ||
|
||
contract CastSendMTokenIndexDev is CastBase { | ||
function run() public { | ||
address signer_ = vm.rememberKey(vm.envUint("DEV_PRIVATE_KEY")); | ||
|
||
address hubPortal_ = vm.parseAddress(vm.prompt("Enter HubPortal address")); | ||
uint16 destinationChainId_ = _getWormholeChainId(vm.parseUint(vm.prompt("Enter destination chain ID"))); | ||
|
||
uint256 deliveryPrice_ = _quoteDeliveryPrice(hubPortal_, destinationChainId_); | ||
console2.log("Delivery price: {}", deliveryPrice_); | ||
|
||
vm.startBroadcast(signer_); | ||
|
||
_sendMTokenIndex(hubPortal_, destinationChainId_, _toUniversalAddress(signer_), deliveryPrice_); | ||
console2.log("M token index sent to Wormhole chain ID {}", destinationChainId_); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about this approach. It doesn't scale well since adding a new chain requires to duplicate all those commands and it's easy to make a copy-paste mistake.
Is it possible to just pass a chain name and read all the required information from json config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can refactor later but we should still keep one command per network.