Skip to content

Commit af31da0

Browse files
committed
Bridge via Across First
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.
1 parent 30bb173 commit af31da0

File tree

2 files changed

+1567
-2
lines changed

2 files changed

+1567
-2
lines changed

src/builder/actions/Actions.sol

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
pragma solidity ^0.8.27;
33

4+
import {console} from "../console.sol";
5+
46
import {Accounts} from "src/builder/Accounts.sol";
57
import {Across, BridgeRoutes, CCTP} from "src/builder/BridgeRoutes.sol";
68
import {CodeJarHelper} from "src/builder/CodeJarHelper.sol";
@@ -610,9 +612,11 @@ library Actions {
610612
pure
611613
returns (IQuarkWallet.QuarkOperation memory, Action memory)
612614
{
613-
if (CCTP.canBridge(bridge.srcChainId, bridge.destinationChainId, bridge.assetSymbol)) {
615+
if (Across.canBridge(bridge.srcChainId, bridge.destinationChainId, bridge.assetSymbol)) {
616+
console.log("Bridging via Across", bridge.assetSymbol);
614617
return bridgeUSDC(bridge, payment, useQuotecall);
615-
} else if (Across.canBridge(bridge.srcChainId, bridge.destinationChainId, bridge.assetSymbol)) {
618+
} else if (CCTP.canBridge(bridge.srcChainId, bridge.destinationChainId, bridge.assetSymbol)) {
619+
console.log("Bridging via CCTP", bridge.assetSymbol);
616620
return bridgeAcross(bridge, payment, useQuotecall);
617621
} else {
618622
revert BridgingUnsupportedForAsset();

0 commit comments

Comments
 (0)