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

[SC-452] Refactor forwarders and receivers #17

Merged
merged 50 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7dbdfe8
adding cctp support
hexonaut May 10, 2024
cf2c3c1
complete circle cctp
hexonaut May 10, 2024
ca6a389
remove get sender function as its pointless in this style of callback
hexonaut May 10, 2024
ede7a78
add polygon and avalanche support
hexonaut May 10, 2024
8e5b368
use more general language for cctp domain
hexonaut May 14, 2024
d3d7e21
rename some of the variables
hexonaut May 14, 2024
616c215
more var renaming; use l2 authority
hexonaut May 14, 2024
506ecc0
review fixes
hexonaut May 17, 2024
9bea858
convert domain into a struct + library; starting to split out bridges…
hexonaut May 18, 2024
418dbb4
more refactoring of bridge
hexonaut May 18, 2024
17c1b3d
part way through testing refactor
hexonaut May 20, 2024
5b03ea7
wip cctp
hexonaut May 20, 2024
f2c3076
Merge branch 'master' into SC-440-refactor-e2e
hexonaut May 20, 2024
2ece5a4
still wip for refactoring bridge testing
hexonaut May 20, 2024
1d966d5
large refactor to split out domains and bridges and move into library…
hexonaut May 24, 2024
17d300c
fix optimism
hexonaut May 24, 2024
8975d01
fix AMB
hexonaut May 29, 2024
46c876f
got arbitrum working
hexonaut May 29, 2024
7af6b4c
refactor XChainForwaders into separate libraries and support both dir…
hexonaut Jun 1, 2024
5540ccd
refactor receivers; started adjusting integration tests
hexonaut Jun 1, 2024
0040372
refactor integration tests
hexonaut Jun 3, 2024
d828811
fix all tests; update readme
hexonaut Jun 4, 2024
200b503
rm unused console
hexonaut Jun 5, 2024
5897ab7
Merge branch 'SC-440-refactor-e2e' into SC-452-refactor-forwards-rece…
hexonaut Jun 5, 2024
1928687
remove the chain specific helper functions
hexonaut Jun 5, 2024
5a8dcfc
add constructor tests for coverage
hexonaut Jun 5, 2024
75e24ce
remove constructor test; add diagram
hexonaut Jun 5, 2024
9d081f1
add unit tests for amb receiver
hexonaut Jun 5, 2024
747c428
add cctp unit test
hexonaut Jun 5, 2024
8190995
change cctp authority type
hexonaut Jun 5, 2024
05e3840
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut Jun 5, 2024
3fcbcce
update to new cctp receiver
hexonaut Jun 5, 2024
5669f7d
add arbitrum receiever unit tests
hexonaut Jun 5, 2024
dc07c16
add optimism test
hexonaut Jun 5, 2024
aade8f0
merge master
hexonaut Jun 7, 2024
9874e5c
use relative paths for library code
hexonaut Jun 8, 2024
46ee62c
fix for subsequent messages
hexonaut Jun 8, 2024
743b951
forge install: openzeppelin-contracts
hexonaut Jun 8, 2024
7eb7d7a
use fallback() instead of forward()
hexonaut Jun 8, 2024
bc5911a
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut Jun 8, 2024
842bf17
dont use absolute paths
hexonaut Jun 9, 2024
3e47e33
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut Jun 9, 2024
6be2397
fix tests to remove forward()
hexonaut Jun 9, 2024
177227a
move image up; more about the receiver; typo
hexonaut Jun 11, 2024
611fe91
formatting
hexonaut Jun 11, 2024
f222fe2
rm old unused commented out line
hexonaut Jun 11, 2024
eea3d6e
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut Jun 12, 2024
0c2893d
review fixes
hexonaut Jun 12, 2024
fd8a5f8
align
hexonaut Jun 12, 2024
1b6d35f
Merge pull request #18 from marsfoundation/SC-437-fix-coverage
hexonaut Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .assets/xchain-helpers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# xchain-helpers

This repository contains tooling for multichain testing such as cross-chain e2e testing support.
This repository three tools for use with multi-chain development. Domains refer to blockchains which are connected by bridges. Domains may have multiple bridges connecting them, for example both the Optimism Native Bridge and Circle CCTP connect Ethereum and Optimism domains.
Copy link
Contributor

Choose a reason for hiding this comment

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

has three

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


## Forwarders

These libraries provide standardized syntax for sending a message to a bridge.

## Receivers

The most common pattern is to have an authorized contract forward a message to another "business logic" contract to abstract away bridge dependencies. Receivers are contracts which perform this generic translation - decoding the bridge-specific message and forwarding to another `target` contract. The `target` contract should have logic to restrict who can call it and permission this to one or more bridge receivers.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should talk about how the receiver itself has the restrictions/requires specific to the bridge and talk about the use of fallbacks and how it routs the message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added another paragraph


![xchain-helpers](.assets/xchain-helpers.png)

## E2E Testing Infrastructure

Provides tooling to record messages sent to supported bridges and relay them on the other side simulating a real message going across.

***
*The IP in this repository was assigned to Mars SPC Limited in respect of the MarsOne SP*
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at dbb610
33 changes: 0 additions & 33 deletions src/ArbitrumReceiver.sol

This file was deleted.

52 changes: 0 additions & 52 deletions src/CCTPReceiver.sol

This file was deleted.

44 changes: 0 additions & 44 deletions src/GnosisReceiver.sol

This file was deleted.

38 changes: 0 additions & 38 deletions src/OptimismReceiver.sol

This file was deleted.

Loading
Loading