From f71a3ba9a50fa1ec3eec8b3409aa98ec625a199b Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 22 Apr 2024 10:23:01 +0200 Subject: [PATCH] feat: still use src channels on callbacks --- script/bridge_contracts.json | 4 ++-- src/apps/polymer/vIBCEscrow.sol | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/bridge_contracts.json b/script/bridge_contracts.json index 20af9e2..324cdf2 100644 --- a/script/bridge_contracts.json +++ b/script/bridge_contracts.json @@ -24,11 +24,11 @@ "Polymer": { "basesepolia": { "bridge": "0x9fcd52449261F732d017F8BD1CaCDc3dFbcD0361", - "escrow": "0x99d4e52dAd393972Cf1586B00cF85Ea6035CA13c" + "escrow": "0xE106643739deB1879CcD8E3ffe2736D8B489bC2F" }, "optimismsepolia": { "bridge": "0xE2029629f51ab994210d671Dc08b7Ec94899b278", - "escrow": "0xb97D0844cD8AfB14275fd4BE747Fce6aD04E7BE8" + "escrow": "0x87AE7bC6B565E545bDD51788C43BF9E5cbB72EBD" } } } \ No newline at end of file diff --git a/src/apps/polymer/vIBCEscrow.sol b/src/apps/polymer/vIBCEscrow.sol index 36c94a5..bc39081 100644 --- a/src/apps/polymer/vIBCEscrow.sol +++ b/src/apps/polymer/vIBCEscrow.sol @@ -152,7 +152,7 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv uint256 gasLimit = gasleft(); bytes32 feeRecipitent = bytes32(uint256(uint160(tx.origin))); - // Collect the implementation identifier we added. Remember, this is trusted IFF packet.dest.channelId is trusted. + // Collect the implementation identifier we added. Remember, this is trusted IFF packet.src.channelId is trusted. bytes memory destinationImplementationIdentifier = ack.data[POLYMER_SENDER_IDENTIFIER_START:POLYMER_SENDER_IDENTIFIER_END]; // Get the payload by removing the implementation identifier. @@ -160,10 +160,10 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv // Set a verificaiton context so we can recover the ack. isVerifiedMessageHash[keccak256(rawMessage)] = VerifiedMessageHashContext({ - chainIdentifier: packet.dest.channelId, + chainIdentifier: packet.src.channelId, implementationIdentifier: destinationImplementationIdentifier }); - _handleAck(packet.dest.channelId, destinationImplementationIdentifier, rawMessage, feeRecipitent, gasLimit); + _handleAck(packet.src.channelId, destinationImplementationIdentifier, rawMessage, feeRecipitent, gasLimit); } function onTimeoutPacket(IbcPacket calldata packet) external override onlyIbcDispatcher{ @@ -175,7 +175,7 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv bytes32 messageIdentifier = bytes32(rawMessage[MESSAGE_IDENTIFIER_START:MESSAGE_IDENTIFIER_END]); address fromApplication = address(uint160(bytes20(rawMessage[FROM_APPLICATION_START_EVM:FROM_APPLICATION_END]))); _handleTimeout( - packet.dest.channelId, messageIdentifier, fromApplication, rawMessage[CTX0_MESSAGE_START:], feeRecipitent, gasLimit + packet.src.channelId, messageIdentifier, fromApplication, rawMessage[CTX0_MESSAGE_START:], feeRecipitent, gasLimit ); }