Skip to content

Commit

Permalink
refactor: address some PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffywaffles committed Jun 7, 2024
1 parent 825c079 commit 421f2c5
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/builder/BridgeRoutes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,18 @@ library CCTP {
uint256 chainId;
uint256 domainId;
address outgoingAddress;
uint256 estimatedCost;
}

error NoKnownBridge(uint256 chainId);
error MissingDomainId(uint256 chainId);
error NoKnownBridge(string bridgeType, uint256 chainId);
error NoKnownDomainId(string bridgeType, uint256 chainId);

function knownDomainId(uint256 chainId) internal pure returns (uint32) {
if (chainId == 1) {
return 0;
} else if (chainId == 8453) {
return 6;
} else {
revert MissingDomainId(chainId);
}
}

function estimatedCost(uint256 chainId) internal pure returns (uint256) {
if (chainId == 1) {
return 1_000_000;
} else {
// TODO: what's the default? Do we need to revert?
return 0;
revert NoKnownDomainId("CCTP", chainId);
}
}

Expand All @@ -86,7 +76,7 @@ library CCTP {
} else if (chainId == 8453) {
return 0x1682Ae6375C4E4A97e4B583BC394c861A46D8962;
} else {
return address(0);
revert NoKnownBridge("CCTP", chainId);
}
}

Expand Down

0 comments on commit 421f2c5

Please sign in to comment.