Skip to content

added Router Protocol adapters #235

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

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

Shivam78288
Copy link

@Shivam78288 Shivam78288 commented Feb 16, 2023

Added Router Protocol Adapters

  • RouterSenderAdapter
  • RouterReceiverAdapter

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

Added deploy script

  • 009_router_sender_adapter
  • 010_router_receiver_adapter

Deployment dev env

Contracts deployed on Polygon Mumbai and Ethereum Goerli chains and configured to send message two way. Mumbai=>Goerli, Goerli=>Mumbai

Addresses

Smart Contract Mumbai Chain Goerli Chain
MockCaller 0xc3c4e615a692f1DA0757523a7a7DdEf96bA7E042 0x4F55446C580E776d57b7bBDE3d2c300587e62A96
MultiBridgeSender 0x7A1Fca8F42cf135Fae9bDaDFeD1a233cCDC3Aeba 0xc3c4e615a692f1DA0757523a7a7DdEf96bA7E042
MultiBridgeReceiver 0x0F66505556029649B74AA3877Ab710A451854b19 0x7A1Fca8F42cf135Fae9bDaDFeD1a233cCDC3Aeba
RouterSenderAdapter 0xe134059918851f5Ffcbf29ED71ea942D0A4f2995 0x0F66505556029649B74AA3877Ab710A451854b19
RouterReceiverAdapter 0x3c29ED6756BB9540B0687C598dBCb0606aEF30b3 0xe134059918851f5Ffcbf29ED71ea942D0A4f2995

Chains

  • Polygon Mumbai (80001)
  • Ethereum Goerli (5)

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

Test

We tested the cross-chain messaging by updating the quorum threshold on the destination chain. Initially we set the power of router's receiver adapter to 100 and quorum threshold to 70 on the Ethereum Goerli chain. Then we tried to update the quorum threshold to 80 by sending a cross-chain message from Polygon Mumbai chain to the Ethereum Goerli chain.
Caller makes a call to remoteCall() function of the MultiBridgeSender with calldata calling updateQuorumThreshold() function of the MultiBridgeReceiver, in order to initiate update of quorum threshold on Ethereum Goerli chain from Polygon Mumbai Chain:

Transfered message:

{
    "bridgeName": "router",
    "callData": "0x6e8b48190000000000000000000000000000000000000000000000000000000000000050",
    "dstChainId": 5,
    "nonce": 0,
    "srcChainId": 80001,
    "target": "0x7A1Fca8F42cf135Fae9bDaDFeD1a233cCDC3Aeba"
}

Initiate update of the Quorum from Polygon Mumbai Chain

Execute message and update Quorum on the Ethereum Goerli Chain

@ClaudeZsb
Copy link
Contributor

Thanks @Shivam78288 for this implementation of Router Protocol and also for a fix of MockCaller.sol.
By the way, contract code for MultiBridge has been copied to a separate repo multibridge and will be maintained there for all future updates, including possible optimization for EIP5164 implementation.

I would merge this PR first and move your code to the new repo. Please request PR in that repo if you have any updates later. Thx.

@ClaudeZsb ClaudeZsb merged commit 72e365a into celer-network:multibridge Feb 20, 2023
@Shivam78288
Copy link
Author

Shivam78288 commented Feb 20, 2023 via email

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.

2 participants