This is a centralized bridge to transfer tokens between EVM-based blockchains. It supports to charge fee in bridging transactions.
- Fork this repository.
- Run
npm install
command to install libraries. - Edit config.js (see below) file.
- Start the app with
node app.js
command. - Set up a cron that sends request to
https://website.com/api/cron
url regularly (every 15-30 seconds).
First of all, you need to deploy Bridge contracts (contracts/bridge.sol
) to all blockchains you will serve. After that, open config.js
file and set the bridge contract address for all chains. You can add or remove chains by editing the array. (image)
In the second step, you should define the tokens. Set the token address for all chains. (image)
Edit pairs
array to set allowed pairs for swapping. You can edit feeMultiplier
if you want to set a transaction fee. (image)
Lastly, you should enter the private key of (bridge contract) deployer address. Always there should be some funds in that account to cover network fees.
I used pure JS (for frontend) because I don't have any experience with external UI libraries. It may cause some confusion, in that case feel free to open an issue from Github.
The author is not responsible for any problems you encounter with the code. Do your own tests and audit before using the software in production mode.