-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
7dbdfe8
adding cctp support
hexonaut cf2c3c1
complete circle cctp
hexonaut ca6a389
remove get sender function as its pointless in this style of callback
hexonaut ede7a78
add polygon and avalanche support
hexonaut 8e5b368
use more general language for cctp domain
hexonaut d3d7e21
rename some of the variables
hexonaut 616c215
more var renaming; use l2 authority
hexonaut 506ecc0
review fixes
hexonaut 9bea858
convert domain into a struct + library; starting to split out bridges…
hexonaut 418dbb4
more refactoring of bridge
hexonaut 17c1b3d
part way through testing refactor
hexonaut 5b03ea7
wip cctp
hexonaut f2c3076
Merge branch 'master' into SC-440-refactor-e2e
hexonaut 2ece5a4
still wip for refactoring bridge testing
hexonaut 1d966d5
large refactor to split out domains and bridges and move into library…
hexonaut 17d300c
fix optimism
hexonaut 8975d01
fix AMB
hexonaut 46c876f
got arbitrum working
hexonaut 7af6b4c
refactor XChainForwaders into separate libraries and support both dir…
hexonaut 5540ccd
refactor receivers; started adjusting integration tests
hexonaut 0040372
refactor integration tests
hexonaut d828811
fix all tests; update readme
hexonaut 200b503
rm unused console
hexonaut 5897ab7
Merge branch 'SC-440-refactor-e2e' into SC-452-refactor-forwards-rece…
hexonaut 1928687
remove the chain specific helper functions
hexonaut 5a8dcfc
add constructor tests for coverage
hexonaut 75e24ce
remove constructor test; add diagram
hexonaut 9d081f1
add unit tests for amb receiver
hexonaut 747c428
add cctp unit test
hexonaut 8190995
change cctp authority type
hexonaut 05e3840
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut 3fcbcce
update to new cctp receiver
hexonaut 5669f7d
add arbitrum receiever unit tests
hexonaut dc07c16
add optimism test
hexonaut aade8f0
merge master
hexonaut 9874e5c
use relative paths for library code
hexonaut 46ee62c
fix for subsequent messages
hexonaut 743b951
forge install: openzeppelin-contracts
hexonaut 7eb7d7a
use fallback() instead of forward()
hexonaut bc5911a
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut 842bf17
dont use absolute paths
hexonaut 3e47e33
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut 6be2397
fix tests to remove forward()
hexonaut 177227a
move image up; more about the receiver; typo
hexonaut 611fe91
formatting
hexonaut f222fe2
rm old unused commented out line
hexonaut eea3d6e
Merge branch 'SC-452-refactor-forwards-receivers' into SC-437-fix-cov…
hexonaut 0c2893d
review fixes
hexonaut fd8a5f8
align
hexonaut 1b6d35f
Merge pull request #18 from marsfoundation/SC-437-fix-coverage
hexonaut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
# xchain-helpers | ||
|
||
This repository contains tooling for multichain testing such as cross-chain e2e testing support. | ||
This repository has 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. | ||
|
||
## Forwarders | ||
|
||
These libraries provide standardized syntax for sending a message to a bridge. | ||
|
||
## Receivers | ||
|
||
![xchain-helpers](.assets/xchain-helpers.png) | ||
|
||
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. | ||
|
||
Most receivers implement a `fallback()` function which after validating that the call came from an authorized party on the other side of the bridge will forward the call to the `target` contract with the same function signature. This separation of concerns makes it easy for the receiver contract to focus on validating the bridge message, and the business logic `target` contract can validate the `msg.sender` comes from the receiver which validates the whole process. This ensures no chain-specific code is required for the business logic contract. | ||
|
||
## 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* |
Submodule openzeppelin-contracts
added at
dbb610
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added another paragraph