-
Notifications
You must be signed in to change notification settings - Fork 7
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
Extract GMP specific logic out of bridge contracts #51
Conversation
📃CI ReportCompiling 146 files with 0.8.19
For a full HTML report run: |
@@ -43,7 +43,7 @@ contract InitializeChildContracts is Script { | |||
childERC20Bridge: ChildERC20Bridge(payable(vm.envAddress("CHILD_ERC20_BRIDGE"))), | |||
childAxelarBridgeAdaptor: ChildAxelarBridgeAdaptor(vm.envAddress("CHILD_BRIDGE_ADAPTOR")), | |||
childTokenTemplate: vm.envAddress("CHILDCHAIN_CHILD_TOKEN_TEMPLATE"), | |||
rootERC20BridgeAdaptor: vm.envAddress("ROOT_BRIDGE_ADAPTOR"), | |||
rootBridgeAdaptor: vm.envAddress("ROOT_BRIDGE_ADAPTOR"), |
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.
QQ, with the introduction of @wcgcyx's scripts, what purpose do these forge scripts hold?
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.
Good question. I believe @wcgcyx PR will remove these scripts once it is merged.
*/ | ||
interface IChildERC20BridgeAdaptor { | ||
interface IChildBridgeAdaptor { |
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.
nice, I see this being generalizable across other asset types
rootBridgeAdaptor = IRootERC20BridgeAdaptor(newRootBridgeAdaptor); | ||
childBridgeAdaptor = newChildBridgeAdaptor; | ||
childChain = newChildChain; | ||
rootBridgeAdaptor = IRootBridgeAdaptor(newRootBridgeAdaptor); |
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.
not for this PR perhaps, but is it worth integrating ERC165 into the adaptor? That is we can check interface IDs on adaptor updating?
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.
Yeah, I agree! I'll capture this on Jira for a future PR.
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.
LGTM
At present, the RootERC20Bridge and ChildERC20Bridge implementations are implicitly linked to Axelar-specific details, such as chain names for chain IDs and string contract addresses. This PR moves these details from the bridge contract to the respective bridge adaptors. A crucial part of this refactor is that the validation of a message's source (i.e., source chain and source address) is now carried out at the bridge adaptor, not at the bridge.
This PR addresses SMR-2023, SMR-2024, SMR-2026