Seamless Swaps, Boundless Bridges!
Built with the tools and technologies:
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.
Before getting started with chain-fusion-poc, ensure your runtime environment meets the following requirements:
- Programming Language: TypeScript
- Package Manager: Yarn
- Container Runtime: Docker
Install aepp-bridge-and-swap using one of the following methods:
Build from source:
- Clone the aepp-bridge-and-swap repository:
❯ git clone https://github.com/aeternity/aepp-bridge-and-swap.git
- Navigate to the project directory:
❯ cd aepp-bridge-and-swap- Install the project dependencies:
❯ yarn❯ docker build -t aeternity/aepp-bridge-and-swap .Run aepp-bridge-and-swap using the following command:
❯ yarn start❯ docker run -it aeternity/aepp-bridge-and-swapRun the test suite using the following command:
❯ yarn testNEXT_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 to4d60aca4542c2...c3676a7c1ccf. Use the sdk to generate a new account.
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.
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 theMNEMONICenvironment variable.deployTestnetBridge.js: Deploys and configures bridge and token contracts on AE testnet; requiresMNEMONIC.fakeBridgeIn.js: Simulates a bridge_in transaction on the AE testnet bridge contract; requiresMNEMONIC.
In general there is no setup required for development, just run the application and start developing:
yarn dev- 💬 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-swapproject.
- Fork the Repository: Start by forking the project repository to your github.com account.
- 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
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to github.com: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!