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

Bridge via Hinting #103

Merged
merged 5 commits into from
Nov 20, 2024
Merged

Bridge via Hinting #103

merged 5 commits into from
Nov 20, 2024

Conversation

hayesgm
Copy link
Contributor

@hayesgm hayesgm commented Nov 14, 2024

This patch simply reverses the order s.t. we bridge via Across if possible, then CCTP otherwise based on a user hint (preferAcross).

Also, we move first-class support for console logs. Note: (a) we'll need to implement console logs in Eth.swift, and (b) we should just update forge-std and then use import {console} from "forge-std/console.sol"; but upgrading forge-std causes stack too deep issues.

@hayesgm hayesgm requested a review from kevincheng96 November 14, 2024 00:51
@hayesgm hayesgm force-pushed the hayesgm/across-first branch 2 times, most recently from 34ac678 to 861e453 Compare November 15, 2024 19:20
@hayesgm hayesgm changed the title Bridge via Across First Bridge via Hinting Nov 15, 2024
@hayesgm hayesgm marked this pull request as ready for review November 15, 2024 19:21
@hayesgm hayesgm force-pushed the hayesgm/across-first branch from 781dbd8 to 995e88f Compare November 15, 2024 23:24
Copy link
Contributor

@kevincheng96 kevincheng96 left a comment

Choose a reason for hiding this comment

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

Simple but effective. Nice work

@@ -1,6 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.27;

import {console} from "../console.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we've been preferring absolute paths over relative paths for imports

@@ -1,6 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.27;

import {console} from "../console.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you just import it from Foundry directly? via import {console} from "forge-std/console.sol"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I could, but then I get a stack too deep error. Go figure :(

@@ -424,6 +455,163 @@ contract QuarkBuilderTransferTest is Test, QuarkBuilderTest {
assertNotEq(result.eip712Data.hashStruct, hex"", "non-empty hashStruct");
}

function testSimpleBridgeWithAcrossTransferSucceeds() public {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a better place to put this would be in BridgeLogic.t.sol so we have a unified place to find the bridging tests.

This patch simply reverses the order s.t. we bridge via Across if possible, then CCTP otherwise. Technically this means we'll never bridge via CCTP, but we'll probably adjust our overall system to allow user-hinting, etc, to retain CCTP support.

Also, we move first-class support for console logs. Note: (a) we'll need to implement console logs in Eth.swift, and (b) we should just update `forge-std` and then use `import {console} from "forge-std/console.sol";` but upgrading forge-std causes stack too deep issues.
@hayesgm hayesgm force-pushed the hayesgm/across-first branch from c8e6569 to 713238f Compare November 20, 2024 23:26
@hayesgm hayesgm merged commit 5c3d0d7 into main Nov 20, 2024
4 checks passed
@hayesgm hayesgm deleted the hayesgm/across-first branch November 20, 2024 23:33
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.

2 participants