Skip to content

aeternity/aepp-bridge-and-swap

Repository files navigation

CHAIN-FUSION-POC

Seamless Swaps, Boundless Bridges!

Built with the tools and technologies:

npm HTML5 Prettier JavaScript React
Yarn Docker TypeScript GitHub%20Actions


Table of Contents


Overview

The ChainFusion-PoC project addresses the challenge of cross-chain asset transfers between Ethereum and Aeternity. The main feature of the application is swapping Ethereum to Aeternity, accomplished by leveraging the ae-bridge and the Superhero DEX while automating the process. It features a user-friendly interface for bridging and swapping tokens, real-time price updates, and seamless wallet integration. Ideal for cryptocurrency enthusiasts and developers, this project enhances interoperability in decentralized finance, simplifying transactions across blockchain networks.


Getting Started

Prerequisites

Before getting started with chain-fusion-poc, ensure your runtime environment meets the following requirements:

  • Programming Language: TypeScript
  • Package Manager: Yarn
  • Container Runtime: Docker

Installation

Install aepp-bridge-and-swap using one of the following methods:

Build from source:

  1. Clone the aepp-bridge-and-swap repository:
❯ git clone https://github.com/aeternity/aepp-bridge-and-swap.git
  1. Navigate to the project directory:
cd aepp-bridge-and-swap
  1. Install the project dependencies:

Using yarn  

❯ yarn

Using docker  

❯ docker build -t aeternity/aepp-bridge-and-swap .

Usage

Run aepp-bridge-and-swap using the following command:

Using yarn  

❯ yarn start

Using docker  

❯ docker run -it aeternity/aepp-bridge-and-swap

Testing

Run the test suite using the following command:

Using yarn  

❯ yarn test

Configuration

Environment Variables

  • NEXT_PUBLIC_SKIP_ETH: Skip the Ethereum-related bridge operations. This a development setting as transaction on the Ethereum Network can be expensive. If the flag is present with any value, the operations will be skipped.
  • AE_PRIVATE_KEY: Private key for the Aeternity account used for paying for the dex swap transactions. This account should be funded with some AE. 1 AE is enough for around 1500 bridge & swap calls. It needs to be in hex format similar to 4d60aca4542c2...c3676a7c1ccf. Use the sdk to generate a new account.

Configuration Variables

The project uses the following configuration variables, defined in the src/constants/index.ts file, to manage cross-chain operations and connections. These variables are predefined with sensible defaults and can be adjusted to suit your specific deployment requirements:

  • ETH_MOCK_ADDRESS: The mock Ethereum token address used for testing purposes.
  • ETH_BRIDGE_ADDRESS: The Ethereum bridge contract address for transferring assets to Aeternity.
  • AE_BRIDGE_ADDRESS: The Aeternity bridge contract address for receiving bridged assets.
  • AE_WAE_ADDRESS: The wrapped Aeternity token (WAE) contract address.
  • AE_DEX_ROUTER_ADDRESS: The Superhero DEX router contract address for facilitating token swaps.
  • AE_WETH_ADDRESS: The wrapped Ethereum token (WETH) contract address on Aeternity.
  • ETH_NATIVE_ETH_PLACEHOLDER_ADDRESS: A placeholder address representing Ethereum’s native token; must be in lowercase.
  • AE_WEB_SOCKET_URL: The WebSocket endpoint for Aeternity's middleware to listen for real-time updates.
  • AE_NODE_URL: The URL for interacting with the Aeternity blockchain node.
  • AE_NETWORK_ID: The identifier for the Aeternity network (e.g., ae_mainnet).
  • AE_MIDDLEWARE_URL: The URL for Aeternity's middleware API to query blockchain data.

Ensure they are correctly configured in your environment before deploying the application.


Development

There are a few scripts within the /scripts folder that can be used to help with development:

  • callDEX.js: Swaps AE for tokens using the AE DEX; requires a mnemonic private key as the MNEMONIC environment variable.
  • deployTestnetBridge.js: Deploys and configures bridge and token contracts on AE testnet; requires MNEMONIC.
  • fakeBridgeIn.js: Simulates a bridge_in transaction on the AE testnet bridge contract; requires MNEMONIC.

In general there is no setup required for development, just run the application and start developing:

yarn dev

Contributing

  • 💬 Join the Discussions: Share your insights, provide feedback, or ask questions.
  • 🐛 Report Issues: Submit bugs found or log feature requests for the aepp-bridge-and-swap project.

Contributing Guidelines

  1. Fork the Repository: Start by forking the project repository to your github.com account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/your-fork/aepp-bridge-and-swap.git
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github.com: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published