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

fix: Add revert for invalid rebalance selector #641

Merged

Conversation

TamaraRingas
Copy link

Problem

In the completeCrossChainRebalance() function, there's an if-else block that checks against data.rebalanceSelector. However, if none of the conditions in this block are met, the function continues to execute. The subsequent _deposit call will fail because none of the router function signatures are matched. It would be more gas efficient to fail earlier in this scenario.

Solution

​Insert a last else in the if-else block:

else {
revert INVALID_REBALANCE_SELECTOR();
}

@TamaraRingas TamaraRingas added the enhancement New feature or request label Oct 18, 2024
@TamaraRingas TamaraRingas self-assigned this Oct 18, 2024
Copy link

linear bot commented Oct 18, 2024

@0xTimepunk 0xTimepunk merged commit 747a726 into v1.5 Oct 18, 2024
6 checks passed
@TamaraRingas TamaraRingas deleted the tamara-sup-8925-fail-sooner-in-completecrosschainrebalance branch October 22, 2024 14:18
@TamaraRingas TamaraRingas restored the tamara-sup-8925-fail-sooner-in-completecrosschainrebalance branch October 24, 2024 10:17
@TamaraRingas TamaraRingas deleted the tamara-sup-8925-fail-sooner-in-completecrosschainrebalance branch October 24, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants