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

Added deBridge adapters #232

Merged
merged 7 commits into from Feb 3, 2023

Conversation

artyukh
Copy link

@artyukh artyukh commented Feb 2, 2023

Added deBridge adapters

  • DeBridgeSenderAdapter
  • DeBridgeReceiverAdapter

MockCaller with AccessControl was added. This contract allows auth wallets to call remoteCall and is needed only for test env.

Added deploy script

  • 000_mock_caller (Not use for prod)
  • 001_multi_bridge_sender (Need to set real caller for prod)
  • 002_multi_bridge_receiver
  • 003_debridge_sender
  • 004_debridge_receiver
  • 005_multibridge_setup (configured for deBridge adapters)

Deployment dev env

Contracts deployed in BNB, Polygon chain and configured to send message on two way. BNB=>Polygon, Polygon=>BNB

Addresses

Smart Contract BNB Chain Polygon Chain
MockCaller 0x51Ac7715b912B7ed1A0aB7897581b242F612501f 0x51Ac7715b912B7ed1A0aB7897581b242F612501f
MultiBridgeSender 0x60b72b6b18D9E7a1054E12045D6759491f29583d 0x60b72b6b18D9E7a1054E12045D6759491f29583d
MultiBridgeReceiver 0x164fb25a73f4FF03d96E86Aa2501BF86aE801f6a 0x164fb25a73f4FF03d96E86Aa2501BF86aE801f6a
DeBridgeSenderAdapter 0xA151bFc6cb938A98A5BfADa67856f0Ed503E9A73 0xA151bFc6cb938A98A5BfADa67856f0Ed503E9A73
DeBridgeReceiverAdapter 0x6fFb8E52A5775c51fc6E6E0678C815B93B068B71 0x6fFb8E52A5775c51fc6E6E0678C815B93B068B71

Chains

  • BNB Chain [56]
  • Polygon Chain [137]

Deployed smart contracts are configured only with deBridge adapters now, but any other bridges can be easily added to the same deployment.

Test

The test transaction performs an update of the quorum threshold in the destination chain.

Caller make a call to remoteCall() of MultiBridgeSender with calldata calling updateQuorumThreshold() of MultiBridgeReceiver, in order to initiate update of quorum threshold in Polygon chain from BNB Chain:

Transfered message

{
"bridgeName":"deBridge"
"callData":"0x6e8b48190000000000000000000000000000000000000000000000000000000000000046"
"dstChainId":137
"nonce":0
"srcChainId":56
"target":"0x164fb25a73f4ff03d96e86aa2501bf86ae801f6a"
}

Cross-chain message in deExplorer
Initiate update of the Quorum from BNB Chain
Execute message and update Quorum in Polygon

@artyukh
Copy link
Author

artyukh commented Feb 2, 2023

Hi @xiaozhou
Could you deploy Celer and Wormhole adapters in the mainnet BNB/Polygon for dev env?


pragma solidity 0.8.17;

import "../../../interfaces/IMessageBus.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import. Same for ICallProxy.sol.

@ClaudeZsb
Copy link
Contributor

005_multibridge_setup may need some modification about dynamically changing network to let it work.

We're pleasant to see the implementation of DeBridge adapters and will merge it. Thx @artyukh

We'll update the setup script and commit it later.

@ClaudeZsb ClaudeZsb merged commit 24ea71e into celer-network:multibridge Feb 3, 2023
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.

None yet

2 participants