-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
3,024 additions
and
272 deletions.
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 { | ||
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.