diff --git a/contracts/contracts/ccip/offramp/contract.tolk b/contracts/contracts/ccip/offramp/contract.tolk index f5cc2090d..fb8c52c77 100644 --- a/contracts/contracts/ccip/offramp/contract.tolk +++ b/contracts/contracts/ccip/offramp/contract.tolk @@ -16,7 +16,7 @@ import "../merkle_root/messages" import "../../lib/receiver/messages" import "../merkle_root/storage" -const CONTRACT_VERSION = "0.0.3"; +const CONTRACT_VERSION = "0.0.4"; fun onInternalMessage(in:InMessage) { val msg = lazy OffRamp_InMessage.fromSlice(in.body); @@ -382,6 +382,9 @@ fun _updateSourceChainConfig(msg: OffRamp_UpdateSourceChainConfig, sender: addre isRMNVerificationDisabled: true, // RMN verification is always disabled onRamp: msg.config.onRamp, }; + emit(SOURCE_CHAIN_SELECTOR_ADDED_TOPIC, SourceChainSelectorAdded { + sourceChainSelector: msg.sourceChainSelector, + }) } else { // OnRamp updates should only happen due to a misconfiguration. // If an OnRamp is misconfigured, no reports should have been @@ -393,6 +396,10 @@ fun _updateSourceChainConfig(msg: OffRamp_UpdateSourceChainConfig, sender: addre } st.sourceChainConfigs.set(msg.sourceChainSelector, config); st.store(); + emit(SOURCE_CHAIN_CONFIG_UPDATED_TOPIC, SourceChainConfigUpdated { + sourceChainSelector: msg.sourceChainSelector, + sourceChainConfig: config, + }) } @pure @inline diff --git a/contracts/contracts/ccip/offramp/events.tolk b/contracts/contracts/ccip/offramp/events.tolk index 4d62bed9b..294e1a145 100644 --- a/contracts/contracts/ccip/offramp/events.tolk +++ b/contracts/contracts/ccip/offramp/events.tolk @@ -10,13 +10,22 @@ struct ExecutionStateChanged { //returnData? probably not } -const CCIP_COMMIT_REPORT_ACCEPTED_TOPIC: int = stringCrc32("CommitReportAccepted"); - +const CCIP_COMMIT_REPORT_ACCEPTED_TOPIC: int = stringCrc32("CCIPCommitReportAccepted"); struct CommitReportAccepted { merkleRoot: MerkleRoot? // vec priceUpdates: Cell?; } +const SOURCE_CHAIN_SELECTOR_ADDED_TOPIC: int = stringCrc32("SourceChainSelectorAdded"); +struct SourceChainSelectorAdded { + sourceChainSelector: uint64; +} + +const SOURCE_CHAIN_CONFIG_UPDATED_TOPIC: int = stringCrc32("SourceChainConfigUpdated"); +struct SourceChainConfigUpdated { + sourceChainSelector: uint64; + sourceChainConfig: SourceChainConfig; +} //TODO not used, remove? struct SkippedAlreadyExecuted { diff --git a/contracts/contracts/ccip/onramp/contract.tolk b/contracts/contracts/ccip/onramp/contract.tolk index 5a6b7b016..00e389c3e 100644 --- a/contracts/contracts/ccip/onramp/contract.tolk +++ b/contracts/contracts/ccip/onramp/contract.tolk @@ -18,7 +18,7 @@ import "../router/messages" import "../../lib/jetton/messages" import "../../lib/jetton/messages_extended" -const CONTRACT_VERSION = "0.0.3"; +const CONTRACT_VERSION = "0.0.4"; fun onInternalMessage(in: InMessage) { val msg = lazy OnRamp_InMessage.fromSlice(in.body); @@ -241,20 +241,29 @@ fun applyDestChainConfigUpdates(mutate st: OnRamp_Storage, updates: cell) { while (!iter.empty()) { val update = iter.next(); // create or update entries + var config: OnRamp_DestChainConfig; val entry = st.destChainConfigs.get(update.destChainSelector); if (entry.isFound) { - var config = entry.loadValue(); + config = entry.loadValue(); config.router = update.router; config.allowlistEnabled = update.allowlistEnabled; st.destChainConfigs.replaceAndGetPrevious(update.destChainSelector, config); } else { - st.destChainConfigs.set(update.destChainSelector, OnRamp_DestChainConfig { + config = OnRamp_DestChainConfig { router: update.router, sequenceNumber: 0, allowlistEnabled: update.allowlistEnabled, allowedSenders: createEmptyMap(), - }) + }; + st.destChainConfigs.set(update.destChainSelector, config); + emit(DEST_CHAIN_SELECTOR_ADDED_TOPIC, DestChainSelectorAdded { + destChainSelector: update.destChainSelector + }); } + emit(DEST_CHAIN_CONFIG_UPDATED_TOPIC, DestChainConfigUpdated { + destChainSelector: update.destChainSelector, + destChainConfig: config, + }); } } diff --git a/contracts/contracts/ccip/onramp/events.tolk b/contracts/contracts/ccip/onramp/events.tolk index 32d26781d..9f2acec42 100644 --- a/contracts/contracts/ccip/onramp/events.tolk +++ b/contracts/contracts/ccip/onramp/events.tolk @@ -5,3 +5,14 @@ const CCIP_MESSAGE_SENT_TOPIC: int = stringCrc32("CCIPMessageSent"); struct CCIPMessageSent { message: TVM2AnyRampMessage; } + +const DEST_CHAIN_SELECTOR_ADDED_TOPIC: int = stringCrc32("DestChainSelectorAdded"); +struct DestChainSelectorAdded { + destChainSelector: uint64; +} + +const DEST_CHAIN_CONFIG_UPDATED_TOPIC: int = stringCrc32("DestChainConfigUpdated"); +struct DestChainConfigUpdated { + destChainSelector: uint64; + destChainConfig: OnRamp_DestChainConfig; +} diff --git a/contracts/tests/Logs.ts b/contracts/tests/Logs.ts index 385c31b46..fd8090dd6 100644 --- a/contracts/tests/Logs.ts +++ b/contracts/tests/Logs.ts @@ -4,8 +4,15 @@ import * as CCIPLogs from '../wrappers/ccip/Logs' import * as OCR3Logs from '../wrappers/libraries/ocr/Logs' import * as ReceiverLogs from '../wrappers/examples/ccip/Logs' import { fromSnakeData } from '../src/utils/types' -import { MerkleRoot, merkleRootFromSlice, priceUpdatesFromCell } from '../wrappers/ccip/OffRamp' +import { + MerkleRoot, + merkleRootFromSlice, + priceUpdatesFromCell, + sourceChainConfigFromSlice, +} from '../wrappers/ccip/OffRamp' import { prettifyAddressesMap } from './utils/prettyPrint' +import { crc32 } from 'zlib' +import * as OR from '../wrappers/ccip/OnRamp' // https://github.com/ton-blockchain/liquid-staking-contract/blob/1f4e9badbed52a4cf80cc58e4bb36ed375c6c8e7/utils.ts#L269-L294 export const getExternals = (transactions: BlockchainTransaction[]) => { @@ -16,7 +23,7 @@ export const getExternals = (transactions: BlockchainTransaction[]) => { export const testLog = ( message: Message, from: Address, - topic: number | bigint, + topic: string, matcher?: (body: Cell) => boolean, ) => { if (message.info.type !== 'external-out') { @@ -25,7 +32,7 @@ export const testLog = ( } if (!message.info.src.equals(from)) return false if (!message.info.dest) return false - if (message.info.dest!.value !== BigInt(topic)) return false + if (message.info.dest!.value !== BigInt(crc32(topic))) return false if (matcher !== undefined) { if (!message.body) console.log('No body') return matcher(message.body) @@ -55,6 +62,10 @@ type LogTypeMap = { [CCIPLogs.LogTypes.CCIPMessageSent]: DeepPartial [CCIPLogs.LogTypes.CCIPCommitReportAccepted]: DeepPartial [CCIPLogs.LogTypes.ExecutionStateChanged]: DeepPartial + [CCIPLogs.LogTypes.SourceChainSelectorAdded]: CCIPLogs.SourceChainSelectorAdded + [CCIPLogs.LogTypes.SourceChainConfigUpdated]: CCIPLogs.SourceChainConfigUpdated + [CCIPLogs.LogTypes.DestChainSelectorAdded]: CCIPLogs.DestChainSelectorAdded + [CCIPLogs.LogTypes.DestChainConfigUpdated]: DeepPartial [OCR3Logs.LogTypes.OCR3BaseConfigSet]: OCR3Logs.OCR3BaseConfigSet [OCR3Logs.LogTypes.OCR3BaseTransmitted]: DeepPartial [ReceiverLogs.LogTypes.ReceiverCCIPMessageReceived]: ReceiverLogs.ReceiverCCIPMessageReceived @@ -87,6 +98,18 @@ const handlers: { [K in CombinedLogType]: Handler } = { [CCIPLogs.LogTypes.ExecutionStateChanged]: (x, from, match) => testLogCCIPExecutionStateChanged(x, from, match as DeepPartial), + [CCIPLogs.LogTypes.SourceChainSelectorAdded]: (x, from, match) => + testLogSourceChainSelectorAdded(x, from, match as CCIPLogs.SourceChainSelectorAdded), + + [CCIPLogs.LogTypes.SourceChainConfigUpdated]: (x, from, match) => + testLogSourceChainConfigUpdated(x, from, match as CCIPLogs.SourceChainConfigUpdated), + + [CCIPLogs.LogTypes.DestChainSelectorAdded]: (x, from, match) => + testLogDestChainSelectorAdded(x, from, match as CCIPLogs.DestChainSelectorAdded), + + [CCIPLogs.LogTypes.DestChainConfigUpdated]: (x, from, match) => + testLogDestChainConfigUpdated(x, from, match as DeepPartial), + [ReceiverLogs.LogTypes.ReceiverCCIPMessageReceived]: (x, from, match) => testLogReceiverCCIPMessageReceived(x, from, match as ReceiverLogs.ReceiverCCIPMessageReceived), @@ -295,6 +318,68 @@ export const testLogReceiverCCIPMessageReceived = ( }) } +export const testLogSourceChainSelectorAdded = ( + message: Message, + from: Address, + match: CCIPLogs.SourceChainSelectorAdded, +) => { + return testLog(message, from, CCIPLogs.LogTypes.SourceChainSelectorAdded, (x) => { + const cs = x.beginParse() + const msg = { + sourceChainSelector: cs.loadUintBig(64), + } + equalsObject(msg, match) + return true + }) +} + +export const testLogSourceChainConfigUpdated = ( + message: Message, + from: Address, + match: CCIPLogs.SourceChainConfigUpdated, +) => { + return testLog(message, from, CCIPLogs.LogTypes.SourceChainConfigUpdated, (x) => { + const cs = x.beginParse() + const msg = { + sourceChainSelector: cs.loadUintBig(64), + config: sourceChainConfigFromSlice(cs), + } + equalsObject(msg, match) + return true + }) +} + +export const testLogDestChainSelectorAdded = ( + message: Message, + from: Address, + match: CCIPLogs.DestChainSelectorAdded, +) => { + return testLog(message, from, CCIPLogs.LogTypes.DestChainSelectorAdded, (x) => { + const cs = x.beginParse() + const msg = { + destChainSelector: cs.loadUintBig(64), + } + equalsObject(msg, match) + return true + }) +} + +export const testLogDestChainConfigUpdated = ( + message: Message, + from: Address, + match: DeepPartial, +) => { + return testLog(message, from, CCIPLogs.LogTypes.DestChainConfigUpdated, (x) => { + const cs = x.beginParse() + const msg = { + destChainSelector: cs.loadUintBig(64), + config: OR.builder.data.destChainConfig().load(cs), + } + matchesObject(msg, match) + return true + }) +} + function matchesObject(obj, match) { expect(obj).toMatchObject(match) } diff --git a/contracts/tests/ccip/CCIPRouter.spec.ts b/contracts/tests/ccip/CCIPRouter.spec.ts index 3852558bb..884d32f1d 100644 --- a/contracts/tests/ccip/CCIPRouter.spec.ts +++ b/contracts/tests/ccip/CCIPRouter.spec.ts @@ -18,7 +18,7 @@ import * as jetton from '../../wrappers/jetton/JettonWallet' import { dump } from '../utils/prettyPrint' import { CellCodec, facilityId } from '../../wrappers/utils' import { crc32 } from 'zlib' -import { CCIP_SEND_EXECUTOR_FACILITY_ID } from '../../wrappers/ccip/OnRamp' +import { CCIP_SEND_EXECUTOR_FACILITY_ID, DestChainConfig } from '../../wrappers/ccip/OnRamp' const CHAINSEL_EVM_TEST_90000001 = 909606746561742123n const CHAINSEL_EVM_TEST_90000002 = 5548718428018410741n @@ -215,13 +215,19 @@ describe('Router', () => { // add config for EVM destination { + const config = { + router: router.address, + sequenceNumber: 0n, + allowlistEnabled: false, + } + const result = await onRamp.sendUpdateDestChainConfigs(deployer.getSender(), { value: toNano('1'), destChainConfigs: [ { destChainSelector: CHAINSEL_EVM_TEST_90000001, - router: router.address, - allowlistEnabled: false, + router: config.router, + allowlistEnabled: config.allowlistEnabled, }, ], }) @@ -231,6 +237,13 @@ describe('Router', () => { deploy: false, success: true, }) + assertLog(result.transactions, onRamp.address, LogTypes.DestChainSelectorAdded, { + destChainSelector: CHAINSEL_EVM_TEST_90000001, + }) + assertLog(result.transactions, onRamp.address, LogTypes.DestChainConfigUpdated, { + destChainSelector: CHAINSEL_EVM_TEST_90000001, + config, + }) } } }) diff --git a/contracts/tests/ccip/OffRamp.spec.ts b/contracts/tests/ccip/OffRamp.spec.ts index 020939589..84a0e5777 100644 --- a/contracts/tests/ccip/OffRamp.spec.ts +++ b/contracts/tests/ccip/OffRamp.spec.ts @@ -16,6 +16,7 @@ import { OFFRAMP_FACILITY_NAME, MERKLE_ROOT_FACILITY_NAME, OFFRAMP_FACILITY_ID, + SourceChainConfig, } from '../../wrappers/ccip/OffRamp' import { OffRamp, OffRampError } from '../../wrappers/ccip/OffRamp' import { FeeQuoter } from '../../wrappers/ccip/FeeQuoter' @@ -153,11 +154,11 @@ describe('OffRamp', () => { ...overrides, }) - const createDefaultSourceChainConfig = (overrides = {}) => ({ + const createDefaultSourceChainConfig = (overrides = {}): SourceChainConfig => ({ router: ROUTER_ADDRESS_TEST, isEnabled: true, minSeqNr: 1n, - isRMNVerificationDisabled: false, + isRMNVerificationDisabled: true, onRamp: bigIntToBuffer(EVM_ONRAMP_ADDRESS_TEST), ...overrides, }) @@ -220,14 +221,25 @@ describe('OffRamp', () => { return result } - const setupSourceChainConfig = async (isEnabled = true, overrides = {}) => { - const config = createDefaultSourceChainConfig({ isEnabled, ...overrides }) + const setupSourceChainConfig = async (overrides = {}, isInitialSetup = true) => { + const config = createDefaultSourceChainConfig({ ...overrides }) const result = await offRamp.sendUpdateSourceChainConfig(deployer.getSender(), { value: toNano('0.5'), sourceChainSelector: CHAINSEL_EVM_TEST_90000001, config, }) expectSuccessfulTransaction(result, deployer.address, offRamp.address) + + if (isInitialSetup) { + assertLog(result.transactions, offRamp.address, CCIPLogs.LogTypes.SourceChainSelectorAdded, { + sourceChainSelector: CHAINSEL_EVM_TEST_90000001, + }) + } + + assertLog(result.transactions, offRamp.address, CCIPLogs.LogTypes.SourceChainConfigUpdated, { + sourceChainSelector: CHAINSEL_EVM_TEST_90000001, + config: config, + }) return result } @@ -449,7 +461,7 @@ describe('OffRamp', () => { const root = createMerkleRoot(1n, 1n, rootBytes) await setupOCRConfig() - await setupSourceChainConfig(false) // disabled source chain + await setupSourceChainConfig({ isEnabled: false }) // disabled source chain const report: CommitReport = { merkleRoots: [root] } const reportContext: ReportContext = { configDigest, padding: 0n, sequenceBytes: 0x01 } @@ -728,7 +740,7 @@ describe('OffRamp', () => { await commitReport([root]) // Disable source chain for execution - await setupSourceChainConfig(false) + await setupSourceChainConfig({ isEnabled: false, minSeqNr: 2n }, false) const report = createExecuteReport([message]) await executeReportExpectingFailure(report, OffRampError.SourceChainNotEnabled) diff --git a/contracts/wrappers/ccip/Logs.ts b/contracts/wrappers/ccip/Logs.ts index 92b80dd26..09457107d 100644 --- a/contracts/wrappers/ccip/Logs.ts +++ b/contracts/wrappers/ccip/Logs.ts @@ -1,15 +1,28 @@ import { Address, Cell } from '@ton/core' import { crc32 } from 'zlib' -import { Any2TVMMessage, MerkleRoot, PriceUpdates } from './OffRamp' +import { Any2TVMMessage, MerkleRoot, PriceUpdates, SourceChainConfig } from './OffRamp' +import { DestChainConfig } from './OnRamp' -export const CCIP_COMMIT_REPORT_ACCEPTED_TOPIC = crc32('CommitReportAccepted') -export const CCIP_MESSAGE_SENT_TOPIC = crc32('CCIPMessageSent') -export const EXECUTION_STATE_CHANGED_TOPIC = crc32('ExecutionStateChanged') +export const LogTypes = { + CCIPMessageSent: 'CCIPMessageSent', + CCIPCommitReportAccepted: 'CCIPCommitReportAccepted', + ExecutionStateChanged: 'ExecutionStateChanged', + SourceChainSelectorAdded: 'SourceChainSelectorAdded', + SourceChainConfigUpdated: 'SourceChainConfigUpdated', + DestChainSelectorAdded: 'DestChainSelectorAdded', + DestChainConfigUpdated: 'DestChainConfigUpdated', +} as const -export enum LogTypes { - CCIPMessageSent = CCIP_MESSAGE_SENT_TOPIC, - CCIPCommitReportAccepted = CCIP_COMMIT_REPORT_ACCEPTED_TOPIC, - ExecutionStateChanged = EXECUTION_STATE_CHANGED_TOPIC, +export type CombinedLogType = (typeof LogTypes)[keyof typeof LogTypes] + +export const LOG_TOPIC: Record = { + CCIPMessageSent: crc32('CCIPMessageSent'), + CCIPCommitReportAccepted: crc32('CCIPCommitReportAccepted'), + ExecutionStateChanged: crc32('ExecutionStateChanged'), + SourceChainSelectorAdded: crc32('SourceChainSelectorAdded'), + SourceChainConfigUpdated: crc32('SourceChainConfigUpdated'), + DestChainSelectorAdded: crc32('DestChainSelectorAdded'), + DestChainConfigUpdated: crc32('DestChainConfigUpdated'), } export type CCIPMessageSent = { @@ -43,3 +56,21 @@ export type ExecutionStateChanged = { messageId: bigint //256 state: bigint //8 } + +export type SourceChainSelectorAdded = { + sourceChainSelector: bigint //64 +} + +export type SourceChainConfigUpdated = { + sourceChainSelector: bigint //64 + config: SourceChainConfig +} + +export type DestChainSelectorAdded = { + destChainSelector: bigint //64 +} + +export type DestChainConfigUpdated = { + destChainSelector: bigint //64 + config: DestChainConfig +} diff --git a/contracts/wrappers/ccip/OffRamp.ts b/contracts/wrappers/ccip/OffRamp.ts index 857f3af13..323558d44 100644 --- a/contracts/wrappers/ccip/OffRamp.ts +++ b/contracts/wrappers/ccip/OffRamp.ts @@ -418,6 +418,16 @@ export const sourceChainConfigToBuilder = (config: SourceChainConfig) => { .storeBuffer(config.onRamp, config.onRamp.byteLength) } +export const sourceChainConfigFromSlice = (slice: Slice): SourceChainConfig => { + return { + router: slice.loadAddress(), + isEnabled: slice.loadBit(), + minSeqNr: slice.loadUintBig(64), + isRMNVerificationDisabled: slice.loadBit(), + onRamp: slice.loadBuffer(slice.loadUint(8)), + } +} + function ExecutionReportToBuilder(report: ExecutionReport) { return beginCell() .storeUint(report.sourceChainSelector, 64) diff --git a/contracts/wrappers/ccip/OnRamp.ts b/contracts/wrappers/ccip/OnRamp.ts index 90addc2b7..059aa94c7 100644 --- a/contracts/wrappers/ccip/OnRamp.ts +++ b/contracts/wrappers/ccip/OnRamp.ts @@ -60,11 +60,17 @@ export type Metadata = { export type DestChainConfig = { router: Address - sequenceNumber: number + sequenceNumber: bigint allowlistEnabled: boolean allowedSenders: Dictionary } +export type UpdateDestChainConfig = { + destChainSelector: bigint + router: Address + allowlistEnabled: boolean +} + const metadataCodec: CellCodec = { encode: function (data: Metadata): Builder { return beginCell().storeAddress(data.sender) @@ -93,7 +99,6 @@ export const builder = { .storeAddress(data.config.allowlistAdmin) .endCell(), ) - // UMap<> type .storeDict(data.destChainConfigs) .storeRef(data.executor_code) .storeUint(data.currentMessageId, 224) @@ -104,6 +109,25 @@ export const builder = { }, } })(), + destChainConfig: (): CellCodec => { + return { + encode: function (data: DestChainConfig): Builder { + return beginCell() + .storeAddress(data.router) + .storeUint(data.sequenceNumber, 64) + .storeBit(data.allowlistEnabled) + .storeDict(data.allowedSenders) + }, + load: function (src: Slice): DestChainConfig { + return { + router: src.loadAddress(), + sequenceNumber: src.loadUintBig(64), + allowlistEnabled: src.loadBit(), + allowedSenders: src.loadDict(Dictionary.Keys.Address(), Dictionary.Values.Bool()), + } + }, + } + }, }, messages: { in: { @@ -191,7 +215,7 @@ export class OnRamp implements Contract { via: Sender, opts: { value: bigint - destChainConfigs: { destChainSelector: bigint; router: Address; allowlistEnabled: boolean }[] + destChainConfigs: UpdateDestChainConfig[] }, ) { await provider.internal(via, { diff --git a/contracts/wrappers/examples/ccip/Logs.ts b/contracts/wrappers/examples/ccip/Logs.ts index b676434fd..ea6d3da4e 100644 --- a/contracts/wrappers/examples/ccip/Logs.ts +++ b/contracts/wrappers/examples/ccip/Logs.ts @@ -1,12 +1,14 @@ import { crc32 } from 'zlib' import { Any2TVMMessage } from '../../ccip/OffRamp' -export const RECEIVER_CCIP_MESSAGE_RECEIVED = crc32('Receiver_CCIPMessageReceived') - -export enum LogTypes { - ReceiverCCIPMessageReceived = RECEIVER_CCIP_MESSAGE_RECEIVED, +export const LOG_TOPIC: Record = { + ReceiverCCIPMessageReceived: crc32('Receiver_CCIPMessageReceived'), } +export const LogTypes = { + ReceiverCCIPMessageReceived: 'Receiver_CCIPMessageReceived', +} as const + export type ReceiverCCIPMessageReceived = { message: Any2TVMMessage } diff --git a/contracts/wrappers/libraries/ocr/Logs.ts b/contracts/wrappers/libraries/ocr/Logs.ts index f82642b16..abbadd094 100644 --- a/contracts/wrappers/libraries/ocr/Logs.ts +++ b/contracts/wrappers/libraries/ocr/Logs.ts @@ -1,14 +1,16 @@ import { Address } from '@ton/core' import { crc32 } from 'zlib' -export const OCR3BASE_CONFIG_SET_TOPIC = crc32('OCR3Base_ConfigSet') -export const OCR3BASE_TRANSMITTED_TOPIC = crc32('OCR3Base_Transmitted') - -export enum LogTypes { - OCR3BaseConfigSet = OCR3BASE_CONFIG_SET_TOPIC, - OCR3BaseTransmitted = OCR3BASE_TRANSMITTED_TOPIC, +export const LOG_TOPIC: Record = { + OCR3Base_ConfigSet: crc32('OCR3Base_ConfigSet'), + OCR3Base_Transmitted: crc32('OCR3Base_Transmitted'), } +export const LogTypes = { + OCR3BaseConfigSet: 'OCR3Base_ConfigSet', + OCR3BaseTransmitted: 'OCR3Base_Transmitted', +} as const + export type OCR3BaseConfigSet = { ocrPluginType: number configDigest: bigint diff --git a/pkg/ccip/bindings/offramp/offramp.go b/pkg/ccip/bindings/offramp/offramp.go index ca5b56a98..11e476a5e 100644 --- a/pkg/ccip/bindings/offramp/offramp.go +++ b/pkg/ccip/bindings/offramp/offramp.go @@ -25,6 +25,15 @@ type ExecutionStateChanged struct { State uint8 `tlb:"## 8"` } +type SourceChainConfigUpdated struct { + SourcehainSelector uint64 `tlb:"## 64"` + SourceChainConfig SourceChainConfig `tlb:"."` +} + +type SourceChainSelectorAdded struct { + SourceChainSelector uint64 `tlb:"## 64"` +} + type Storage struct { ID uint32 `tlb:"## 32"` Ownable common.Ownable2Step `tlb:"."` diff --git a/pkg/ccip/bindings/onramp/onramp.go b/pkg/ccip/bindings/onramp/onramp.go index cf9684f45..70aa77e8b 100644 --- a/pkg/ccip/bindings/onramp/onramp.go +++ b/pkg/ccip/bindings/onramp/onramp.go @@ -17,6 +17,15 @@ type CCIPMessageSent struct { Message ocr.TVM2AnyRampMessage `tlb:"."` } +type DestChainSelectorAdded struct { + DestChainSelector uint64 `tlb:"## 64"` +} + +type DestChainSelectorUpdated struct { + DestChainSelector uint64 `tlb:"## 64"` + Config DestChainConfig `tlb:"."` +} + // GenericExtraArgsV2 represents generic extra arguments for transactions. type GenericExtraArgsV2 struct { _ tlb.Magic `tlb:"#181dcf10"` //nolint:revive // Ignore opcode tag // hex encoded bytes4(keccak256("CCIP EVMExtraArgsV2")), can be verified with hexutil.MustDecode("0x181dcf10")