Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: USDS migration for xDAI bridge #7

Open
wants to merge 9 commits into
base: xdaibridge
Choose a base branch
from

Conversation

zengzengzenghuy
Copy link

What

Background: https://forum.gnosis.io/t/gip-118-should-sdai-be-replaced-by-susds-in-the-bridge/9354

How

  1. New Router contract(BridgeRouter.sol) to route relayTokens function and claim token executeSignatuers to xDAI bridge or Omnibridge, or others in future upgrade
    1. Router contract is controlled by bridge governors and upgradeable
    2. Routes:
      1. DAI → XDaiBridgePeripheral
      2. USDS → XDaiBridge
      3. ETH →WETHOmnibridgeRouter
      4. Other tokens → Omnibridge
  2. xDAI bridge only accepts deposit from USDS token.
    1. Function interfaces are not changed, but only changing the address of daiToken() to USDS and sDaiToken() to sUSDS.

New contracts

  1. BridgeRouter: https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/contracts/upgradeable_contracts/erc20_to_native/BridgeRouter.sol , Upgradeable with TransparentUpgradeableProxy https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/contracts/upgradeability/TransparentUpgradeableProxy.sol
  2. XDaiBridgePeripheral: https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/contracts/upgradeable_contracts/erc20_to_native/XDaiBridgePeripheral.sol

Modified contracts

  1. XDaiForeignBridge: https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/contracts/upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol
  2. SavingsDaiConnector: https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/contracts/upgradeable_contracts/erc20_to_native/SavingsDaiConnector.sol

Fork Test

https://github.com/gnosischain/tokenbridge-contracts/blob/feat/xdai-usds-migration/test/foundry/forkTest.sh

Bridge validator test (Check if bridge validator continues to work after bridge migration & xDAI can be still be minted on Gnosis Chain)

https://github.com/gnosischain/xdai-bridge-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants