Skip to content

Conversation

@pxrl
Copy link
Contributor

@pxrl pxrl commented Dec 23, 2025

This PR adds support for CCTP to the OP Adapter implementation.

This PR adds support for CCTP to the OP Adapter implementation.

Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
@pxrl pxrl added the do not merge do not merge label Dec 23, 2025
Comment on lines 38 to 39
| Optimism_Adapter | [0xE1e74B3D6A8E2A479B62958D4E4E6eEaea5B612b](https://etherscan.io/address/0xE1e74B3D6A8E2A479B62958D4E4E6eEaea5B612b) |
| Optimism_Adapter | [0x3562e309C6C79626E5F0Cf746FB5Bf4f6b8EebE5](https://etherscan.io/address/0x3562e309C6C79626E5F0Cf746FB5Bf4f6b8EebE5) |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Driveby comment - we shouldn't have two Optimism_Adapter instances - that's pre-existing but can be tidied up here.

Comment on lines -230 to +232
return uint256(cctpDomain);
return uint32(uint256(cctpDomain));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CCTP Domain ID is max 32 bits, so truncate it here after bounds checking.

struct OpStackAddresses {
address L1CrossDomainMessenger;
address L1StandardBridge;
address L1BlastBridge;
Copy link
Contributor Author

@pxrl pxrl Dec 23, 2025

Choose a reason for hiding this comment

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

The Blast bridge is a total snowflake and I don't anticipate any further deployments there because the chain seems a bit stale these days. If we do need to support additional Blast depoyments in future then I'd propose we handle it as a special case, rather than baking it into the common OP deployment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nb. the bones of this file were taken from script/024DeployBaseAdapter.s.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.

Not sure if it's inteded to add this; can easily drop it if not.

@pxrl pxrl changed the title chore: Support CCTP in OP Adapter chore: Support CCTP in OP Adapter + deploy Ink adapter Dec 23, 2025
| LpTokenFactory | [0x7dB69eb9F52eD773E9b03f5068A1ea0275b2fD9d](https://etherscan.io/address/0x7dB69eb9F52eD773E9b03f5068A1ea0275b2fD9d) |
| Mode_Adapter | [0xf1B59868697f3925b72889ede818B9E7ba0316d0](https://etherscan.io/address/0xf1B59868697f3925b72889ede818B9E7ba0316d0) |
| MulticallHandler | [0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E](https://etherscan.io/address/0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E) |
| OP_Adapter | [0x83057C549C6489899651012F84A36fA58FE2079e](https://etherscan.io/address/0x83057C549C6489899651012F84A36fA58FE2079e) |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reviving old comment - this should ideally be OP_Adapter_<chainId> (OP_Adapter_57073 in this case).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented: 5917380

@pxrl pxrl marked this pull request as draft December 23, 2025 13:10

// Get the current chain ID
uint256 chainId = block.chainid;
uint32 cctpDomain = getCircleDomainId(spokeChainId);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has to be conditional on hasCctpDomain() because otherwise it'll revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addresed here: b3a9f9f

Comment on lines +185 to +194
// nb. This is fragile. @todo: Improve.
switch (contractName) {
case "Universal_Adapter":
cctpDomainId = tx.arguments.at(3);
oftDstEid = tx.arguments.at(5);
break;
case "OP_Adapter":
cctpDomainId = tx.arguments.at(6);
break;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fusmanii I extended this to support the OP adapter contract, but we're relying on a hard coupling of constructor argument ordering here. I've just extended what we already have but wondered if you had any thoughts about how it could be improved. wdyt?

@pxrl pxrl changed the title chore: Support CCTP in OP Adapter + deploy Ink adapter chore: Foundry script for OP Adapter deloyment + deploy Ink adapter Dec 23, 2025
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​across-protocol/​constants@​3.1.88 ⏵ 3.1.9480 +110074 +19970

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants