Tutorial for deploying ERC20-ERC20 bridge on xDai?

I tried out Austin Griffith’s burner wallet on xdai and was really impressed with how fast the network ran.

Is it possible to deploy my ERC20 token COLR to the xdai network - how would I go about setting up a bridge? I would like users to be able to use a burner wallet to interact with xCOLR on the xDai network - but I’m not sure if I understand everything correctly - is such a thing even possible?

1 Like

Welcome to the forum!
We invite you to try our new type of bridge (Arbitrary Message Bridge). Using AMB you can transfer any tokens between two networks.

The bridge is already deployed.
You need to make contracts for your token and deploy them on both sides.
Here is an example for sUSD token https://docs.tokenbridge.net/eth-xdai-amb-bridge/susd-bridge-extension and GEN token https://docs.tokenbridge.net/eth-xdai-amb-bridge/gen-xgen-bridge-extension

Read more about AMB https://docs.tokenbridge.net/amb-bridge/about-amb-bridge

1 Like

This seems like the kind of thing that could be automated for standard ERC20 tokens.

Is it possible to set up a pair of Factory contracts so that deploying an ERC20-ERC20 bridge was as simple as “call this function on Ethereum” and then “call this function on xDaiChain”?


Is this what you are looking for?

I think so! I’ll try it out if gas prices ever get below 100 gwei again.

Who does the 0.5% fee get paid to?

It will be paid to the bridge validator to cover expenses for sending transaction with confirmations to the Mainnet.

1 Like

But we decided to reduce it to 0.05% today.

1 Like

That’s not what gas pays for?

it seems weird that it’s a percent and not a fixed fee considering it should be a fixed cost for the validator.

You point out the gas fees to reward the network validators. The multi-token mediator’s fee is to reward the bridge validator.

There are bunch of applications in Ethereum that provide a service for a percent of the supplied value.

If you don’t like this model you can deploy your own pair of mediators (https://docs.tokenbridge.net/eth-xdai-amb-bridge/erc20-to-erc20-extension-linked-with-a-particular-token) and it could be configured as so to cost you no fee at all to transfer any amount of tokens.

1 Like

Fair enough.

I’m mostly just trying to learn about the technology. xDaiChain seems to be one of the only l2’s with a working bridge and turing-complete contracts right now so I’m excited to try it out.

Do you know if someone has already deployed a Uniswap clone on xDaiChain?

1 Like

Yeah, 1hive did this: https://www.xdaichain.com/about-xdai/project-spotlights/1hive#honey-liquidity-and-exchange

Sweet! I’ll have to check that out!