Skip to content

lifinance/MMAxERC20

Repository files navigation

xERC20 <> Multi-Message Aggregation (MMA)

A demonstration model for an xERC20 token, as outlined by ERC-7281, utilizing the Multiple Arbitrary Message Bridge framework built by Uniswap Foundation in partnership with LI.FI.

Introduction

xERC20 addresses the challenges of fragmented liquidity across various blockchains and the risks associated with relying on a single Arbitrary Message Bridge (AMB). However, it faces limitations related to the minting and burning caps. To overcome these drawbacks, this model employs a combination of message bridges without any constraints, effectively resolving these issues on a broader level.

Diagram

Local Development

Step 1: Clone the repository

$   git clone https://github.com/lifinance/MMAxERC20

note: Please make sure foundry is installed to proceed further.

Step 2: Install required forge submodules

$  forge install

Step 3: Compile

$  forge build

Step 4: Run Tests

To run the tests, you will need a local fork of Ethereum, Polygon, and BSC mainnet states. To accomplish this, you must specify RPC endpoints for each of these networks. You can obtain RPC endpoints to use for Ethereum and Polygon, from Alchemy, Infura, or other infrastructure providers. For BSC, you can choose from a list of public RPC endpoints available here.

To set the RPC endpoints, make a copy of the .env.sample file and name it .env. The file contains a list of parameter names (e.g. ETH_FORK_URL) that correspond to each network. Set the respective values of each of these parameters to the RPC endpoints you wish to use.

Once you have set these values, you can run both the unit and integration tests using the following command:

```sh
$  forge test

note: We use pigeon to simulate the cross-chain behavior on forked mainnets.

How to contribute ?

Reporting bugs and issues

If you find any bugs or issues with the project, please create a GitHub issue and include as much detail as possible.

Code contribution

If you want to contribute code to the project, please follow these guidelines:

  1. Fork the project repository and clone it to your local machine.
  2. Create a new branch for your changes.
  3. Make your changes and test them thoroughly.
  4. Ensure that your changes are well-documented.
  5. Create a pull request and explain your changes in detail.
  6. Code review
  7. All code changes will be reviewed by the project maintainers. The maintainers may ask for additional changes, and once the changes have been approved, they will be merged into the main branch.

Testing

All code changes must be thoroughly tested. Please ensure that your tests cover all new functionality and edge cases.

Contracts

contracts
├── MultiBridgeMessageReceiver.sol
├── MultiBridgeMessageSender.sol
├── adapters
│   ├── 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
│   └── IMultiBridgeMessageReceiver.sol
└── token
    ├── xERC20.sol
└── libraries
    ├── Error.sol
    ├── Message.sol
    ├── TypeCasts.sol
    └── Types.sol

License

By contributing to the project, you agree that your contributions will be licensed under the project's LICENSE.

Disclaimer

This is experimental software and is provided on an "as is" basis. Parts of the code are audited, but largely unaudited. No expressed or implied warranties are granted of any kind. I will not be liable for any loss, direct or indirect, related to the use or misuse of this codebase.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published