Skip to content

hyperevm: native refund ladder improvement - #1607

Merged
shankars99 merged 3 commits into
mainfrom
hyperliquid/native-fallback
Jul 9, 2025
Merged

hyperevm: native refund ladder improvement#1607
shankars99 merged 3 commits into
mainfrom
hyperliquid/native-fallback

Conversation

@shankars99

Copy link
Copy Markdown
Collaborator
       if (msg.value > 0) {
            try this.fundAddressOnHyperCore(receiver, msg.value, _executor) {} catch (bytes memory _err) {
                this.refundNativeTokens{ value: msg.value }(receiver);
                bytes memory errMsg = completeRefund(_err, _executor);
                emit ErrorMessage(errMsg);
            }
        }

was the initial design. refundNativeTokens() and completeRefund() would both try refunding the user. while this doesnt double refund, it can revert if the first line reverts.

Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
@shankars99 shankars99 changed the title fixing fallback ladder hyperevm: fixing fallback ladder Jul 9, 2025
@shankars99 shankars99 changed the title hyperevm: fixing fallback ladder hyperevm: native refund ladder improvement Jul 9, 2025

@AlexanderLiteplo AlexanderLiteplo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wow thats very cool

@ravinagill15 ravinagill15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@shankars99
shankars99 merged commit eba8cd6 into main Jul 9, 2025
11 checks passed
@shankars99
shankars99 deleted the hyperliquid/native-fallback branch July 9, 2025 22:00
shankars99 added a commit that referenced this pull request Jul 20, 2025
Signed-off-by: shankar <shankar@layerzerolabs.org>
mattsse pushed a commit to mattsse/devtools that referenced this pull request Aug 12, 2025
Signed-off-by: shankar <shankar@layerzerolabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants