From 9e1ff4107ef70ffab0f859729faee507b05fc940 Mon Sep 17 00:00:00 2001 From: Farber98 Date: Fri, 12 Dec 2025 16:38:56 -0300 Subject: [PATCH 1/3] getDestChainConfig binding --- contracts/wrappers/ccip/OnRamp.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contracts/wrappers/ccip/OnRamp.ts b/contracts/wrappers/ccip/OnRamp.ts index 6489e4877..0b19b2743 100644 --- a/contracts/wrappers/ccip/OnRamp.ts +++ b/contracts/wrappers/ccip/OnRamp.ts @@ -742,6 +742,20 @@ export class OnRamp implements Contract, withdrawable.Interface, ownable2step.Co return typeAndVersion.getCodeHash(provider) } + async getDestChainConfig(provider: ContractProvider, destChainSelector: bigint): Promise { + return provider.get('destChainConfig', [{ type: 'int', value: destChainSelector }]).then((res) => { + const stack = res.stack; + return { + router: stack.readAddress(), + sequenceNumber: stack.readBigNumber(), + allowlistEnabled: stack.readBoolean(), + allowedSenders: stack.readCellOpt() ? + Dictionary.loadDirect(Dictionary.Keys.Address(), Dictionary.Values.Bool(), stack.readCell()) : + Dictionary.empty(), + }; + }); + } + static version() { return ONRAMP_CONTRACT_VERSION } From 2e14c8abe479f8f8de0ce18fe2b3df762d7fb8bc Mon Sep 17 00:00:00 2001 From: Farber98 Date: Fri, 12 Dec 2025 16:40:43 -0300 Subject: [PATCH 2/3] fix --- contracts/wrappers/ccip/OnRamp.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/contracts/wrappers/ccip/OnRamp.ts b/contracts/wrappers/ccip/OnRamp.ts index 0b19b2743..7412d9c3a 100644 --- a/contracts/wrappers/ccip/OnRamp.ts +++ b/contracts/wrappers/ccip/OnRamp.ts @@ -743,17 +743,19 @@ export class OnRamp implements Contract, withdrawable.Interface, ownable2step.Co } async getDestChainConfig(provider: ContractProvider, destChainSelector: bigint): Promise { - return provider.get('destChainConfig', [{ type: 'int', value: destChainSelector }]).then((res) => { - const stack = res.stack; - return { - router: stack.readAddress(), - sequenceNumber: stack.readBigNumber(), - allowlistEnabled: stack.readBoolean(), - allowedSenders: stack.readCellOpt() ? - Dictionary.loadDirect(Dictionary.Keys.Address(), Dictionary.Values.Bool(), stack.readCell()) : - Dictionary.empty(), - }; - }); + const { stack } = await provider.get('destChainConfig', [{ type: 'int', value: destChainSelector }]); + const router = stack.readAddress(); + const sequenceNumber = stack.readBigNumber(); + const allowlistEnabled = stack.readBoolean(); + const allowedSendersCell = stack.readCellOpt(); + return { + router, + sequenceNumber, + allowlistEnabled, + allowedSenders: allowedSendersCell + ? Dictionary.loadDirect(Dictionary.Keys.Address(), Dictionary.Values.Bool(), allowedSendersCell) + : Dictionary.empty(), + }; } static version() { From a5468fbc4c358f585e31a61b0a041d62623807ac Mon Sep 17 00:00:00 2001 From: Farber98 Date: Fri, 12 Dec 2025 16:44:36 -0300 Subject: [PATCH 3/3] lint --- contracts/wrappers/ccip/OnRamp.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/contracts/wrappers/ccip/OnRamp.ts b/contracts/wrappers/ccip/OnRamp.ts index 7412d9c3a..7fcad45d4 100644 --- a/contracts/wrappers/ccip/OnRamp.ts +++ b/contracts/wrappers/ccip/OnRamp.ts @@ -742,20 +742,29 @@ export class OnRamp implements Contract, withdrawable.Interface, ownable2step.Co return typeAndVersion.getCodeHash(provider) } - async getDestChainConfig(provider: ContractProvider, destChainSelector: bigint): Promise { - const { stack } = await provider.get('destChainConfig', [{ type: 'int', value: destChainSelector }]); - const router = stack.readAddress(); - const sequenceNumber = stack.readBigNumber(); - const allowlistEnabled = stack.readBoolean(); - const allowedSendersCell = stack.readCellOpt(); + async getDestChainConfig( + provider: ContractProvider, + destChainSelector: bigint, + ): Promise { + const { stack } = await provider.get('destChainConfig', [ + { type: 'int', value: destChainSelector }, + ]) + const router = stack.readAddress() + const sequenceNumber = stack.readBigNumber() + const allowlistEnabled = stack.readBoolean() + const allowedSendersCell = stack.readCellOpt() return { router, sequenceNumber, allowlistEnabled, allowedSenders: allowedSendersCell - ? Dictionary.loadDirect(Dictionary.Keys.Address(), Dictionary.Values.Bool(), allowedSendersCell) + ? Dictionary.loadDirect( + Dictionary.Keys.Address(), + Dictionary.Values.Bool(), + allowedSendersCell, + ) : Dictionary.empty(), - }; + } } static version() {