Skip to content

Commit

Permalink
Fix typo and update directory structure in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominator008 committed Sep 14, 2023
1 parent 99880e3 commit 227be07
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 32 deletions.
56 changes: 35 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Instead of relying on a single AMB, MMA allows the message sender to relay the m

## Features
### Core MMA architecture
- **Minimized feature sets**: barebore implementation, low level of complexity.
- **Minimized feature sets**: barebone implementation, low level of complexity.
- **Configurable**: during deployment, individual project can configure their own parameters to fit their specific use case and risk tolerance.
### Adapter
- **Standardization**: Implements EIP-5164 for all APIs on the sending and receiving end.
Expand All @@ -30,7 +30,7 @@ On the destination chain, if 2 of the 3 AMB agree with each other, we would cons
The flow of the message and how it is transformed and relayed is detailed below:

1. Uniswap Ethereum governance structure, `src`, approves to execute a message `msg` on destination chain `dst`.
2. Uniswap governance sends `msg` to `MultiMessageSender`.
2. Uniswap governance sends `msg` to `MultiMessageSender`.
3. `MultiMessageSender` relays `msg` to different adapters `adapter`.
4. `adapter` encodes `msg` into the corresponding formatted message, `formatted_msg`, and sends it to the hardcoded AMB contracts `AMB`.
5. Each `AMB` independently carries `formatted_msg` to `dst`.
Expand All @@ -50,7 +50,7 @@ $ git clone https://github.com/MultiMessageAggregation/multibridge

**note:** Please make sure [foundry](https://github.com/foundry-rs/foundry) is installed to proceed further.

**Step 2:** Install required forge submodules
**Step 2:** Install required forge submodules

```sh
$ forge install
Expand Down Expand Up @@ -97,27 +97,41 @@ All code changes must be thoroughly tested. Please ensure that your tests cover
## Contracts
```
contracts
├── MessageStruct.sol
├── MultiMessageReceiver.sol
├── MultiMessageSender.sol
├── interfaces
│ ├── EIP5164
│ │ ├── ExecutorAware.sol
│ │ ├── MessageDispatcher.sol
│ │ ├── MessageExecutor.sol
│ │ └── SingleMessageDispatcher.sol
│ ├── IBridgeReceiverAdapter.sol
│ ├── IBridgeSenderAdapter.sol
│ └── IMultiMessageReceiver.sol
├── adapters
│ ├── Celer
│ ├── Hyperlane
│ ├── Telepathy
│ ├── Wormhole
│ ├── base
│ ├── debridge
│ └── router
└── mock
│   ├── BaseSenderAdapter.sol
│   ├── axelar
│   │   ├── AxelarReceiverAdapter.sol
│   │   ├── AxelarSenderAdapter.sol
│   │   ├── interfaces
│   │   │   ├── IAxelarExecutable.sol
│   │   │   ├── IAxelarGasService.sol
│   │   │   └── IAxelarGateway.sol
│   │   └── libraries
│   │   └── StringAddressConversion.sol
│   └── wormhole
│   ├── WormholeReceiverAdapter.sol
│   └── WormholeSenderAdapter.sol
├── controllers
│   ├── GAC.sol
│   └── GovernanceTimelock.sol
├── interfaces
│   ├── EIP5164
│   │   ├── ExecutorAware.sol
│   │   ├── MessageDispatcher.sol
│   │   ├── MessageExecutor.sol
│   │   └── SingleMessageDispatcher.sol
│   ├── IGAC.sol
│   ├── IGovernanceTimelock.sol
│   ├── IMessageReceiverAdapter.sol
│   ├── IMessageSenderAdapter.sol
│   └── IMultiMessageReceiver.sol
└── libraries
├── Error.sol
├── Message.sol
├── TypeCasts.sol
└── Types.sol
```

## License
Expand Down
20 changes: 10 additions & 10 deletions test/Setup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ abstract contract Setup is Test {
/// @notice deploy source adapter to SRC_CHAIN (ETH)
vm.selectFork(fork[ETHEREUM_CHAIN_ID]);

contractAddress[1][bytes("WORMHOLE_SENDER_ADAPTER")] =
address(new WormholeSenderAdapter{salt: _salt}(ETH_RELAYER, contractAddress[1][bytes("GAC")]));
contractAddress[ETHEREUM_CHAIN_ID][bytes("WORMHOLE_SENDER_ADAPTER")] = address(
new WormholeSenderAdapter{salt: _salt}(ETH_RELAYER, contractAddress[ETHEREUM_CHAIN_ID][bytes("GAC")])
);

uint256 len = DST_CHAINS.length;

Expand All @@ -174,11 +175,10 @@ abstract contract Setup is Test {
/// @dev sets some configs to sender adapter (ETH_CHAIN_ADAPTER)
vm.selectFork(fork[ETHEREUM_CHAIN_ID]);

WormholeSenderAdapter(contractAddress[1][bytes("WORMHOLE_SENDER_ADAPTER")]).updateReceiverAdapter(
DST_CHAINS, _receiverAdapters
);
WormholeSenderAdapter(contractAddress[ETHEREUM_CHAIN_ID][bytes("WORMHOLE_SENDER_ADAPTER")])
.updateReceiverAdapter(DST_CHAINS, _receiverAdapters);

WormholeSenderAdapter(contractAddress[1][bytes("WORMHOLE_SENDER_ADAPTER")]).setChainIdMap(
WormholeSenderAdapter(contractAddress[ETHEREUM_CHAIN_ID][bytes("WORMHOLE_SENDER_ADAPTER")]).setChainIdMap(
DST_CHAINS, WORMHOLE_CHAIN_IDS
);
}
Expand Down Expand Up @@ -226,8 +226,8 @@ abstract contract Setup is Test {
function _deployHelpers() internal {
/// @notice deploy amb helpers to Ethereum
vm.selectFork(fork[ETHEREUM_CHAIN_ID]);
contractAddress[1][bytes("WORMHOLE_HELPER")] = address(new WormholeHelper());
contractAddress[1][bytes("AXELAR_HELPER")] = address(new AxelarHelper());
contractAddress[ETHEREUM_CHAIN_ID][bytes("WORMHOLE_HELPER")] = address(new WormholeHelper());
contractAddress[ETHEREUM_CHAIN_ID][bytes("AXELAR_HELPER")] = address(new AxelarHelper());

vm.allowCheatcodes(contractAddress[1][bytes("WORMHOLE_HELPER")]);
vm.allowCheatcodes(contractAddress[1][bytes("AXELAR_HELPER")]);
Expand All @@ -253,8 +253,8 @@ abstract contract Setup is Test {
function _deployCoreContracts() internal {
/// @notice deploy mma sender to ETHEREUM
vm.selectFork(fork[ETHEREUM_CHAIN_ID]);
contractAddress[1][bytes("MMA_SENDER")] =
address(new MultiMessageSender{salt: _salt}(contractAddress[1][bytes("GAC")]));
contractAddress[ETHEREUM_CHAIN_ID][bytes("MMA_SENDER")] =
address(new MultiMessageSender{salt: _salt}(contractAddress[ETHEREUM_CHAIN_ID][bytes("GAC")]));

/// @notice deploy amb helpers to BSC & POLYGON
for (uint256 i; i < DST_CHAINS.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion test/contracts-mock/MockUniswapReceiver.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.9;

/// @dev assumes mock interactor is the one that send / recieves message using the MMA infra
/// @dev assumes mock interactor is the one that send / receives message using the MMA infra
contract MockUniswapReceiver {
uint256 public i;

Expand Down

0 comments on commit 227be07

Please sign in to comment.