-
Notifications
You must be signed in to change notification settings - Fork 357
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
fix: EVM-708 bridge fixes #703
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
820994b
bridge fixes
kelemeno 1bec619
typo
kelemeno 36aded3
some fixes
kelemeno 870d6e7
build fix
kelemeno cb91249
remove admin facet
kelemeno e81b117
fixes
kelemeno a577980
fix
kelemeno 015f05c
slither issue
kelemeno d4d547d
solhint
kelemeno 98a053a
more fixes
kelemeno 7dfbefb
slither
kelemeno 77aca06
slither
kelemeno 93217f0
where to put the slither comment
kelemeno 9b1109f
slither
kelemeno 3066c8b
more fixes
kelemeno 485df95
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno 915017a
lint
kelemeno f7891da
fix
kelemeno a87ab57
old comment
kelemeno 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
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 |
---|---|---|
|
@@ -183,6 +183,19 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus | |
require(token != address(0), "BH: token not set"); | ||
baseTokenAssetId[_chainId] = DataEncoding.encodeNTVAssetId(block.chainid, token); | ||
} | ||
|
||
/// @notice Used to set the legacy chain address for the upgrade. | ||
/// @notice This has to be used after the BH but before the STM is upgraded. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the comment is not correct, it has to be used after STM is upgraded, since |
||
/// @param _chainId The chainId of the legacy chain we are migrating. | ||
function setLegacyChainAddress(uint256 _chainId) external { | ||
address stm = stateTransitionManager[_chainId]; | ||
require(stm != address(0), "BH: chain not legacy"); | ||
require(!hyperchainMap.contains(_chainId), "BH: chain already migrated"); | ||
/// Note we have to do this before STM is upgraded. | ||
address chainAddress = IStateTransitionManager(stm).getHyperchainLegacy(_chainId); | ||
require(chainAddress != address(0), "BH: chain not legacy 2"); | ||
_registerNewHyperchain(_chainId, chainAddress); | ||
} | ||
|
||
//// Registry | ||
|
||
|
Oops, something went wrong.
You are viewing a condensed version of this merge commit. You can view the full changes here.
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.
should be checked that the chain does not yet have the base token asset id set.
Probably reverting in case the token is set is too much (since the method is public and be frontrun), but at least not overwriting the base token should be done in case some chains have custom asset handler for base token