Skip to content

Commit

Permalink
feat: still use src channels on callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Apr 22, 2024
1 parent 955b5c6 commit f71a3ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions script/bridge_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"Polymer": {
"basesepolia": {
"bridge": "0x9fcd52449261F732d017F8BD1CaCDc3dFbcD0361",
"escrow": "0x99d4e52dAd393972Cf1586B00cF85Ea6035CA13c"
"escrow": "0xE106643739deB1879CcD8E3ffe2736D8B489bC2F"
},
"optimismsepolia": {
"bridge": "0xE2029629f51ab994210d671Dc08b7Ec94899b278",
"escrow": "0xb97D0844cD8AfB14275fd4BE747Fce6aD04E7BE8"
"escrow": "0x87AE7bC6B565E545bDD51788C43BF9E5cbB72EBD"
}
}
}
8 changes: 4 additions & 4 deletions src/apps/polymer/vIBCEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,18 @@ 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.
bytes calldata rawMessage = ack.data[POLYMER_PACKAGE_PAYLOAD_START:];

// 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{
Expand All @@ -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
);
}

Expand Down

0 comments on commit f71a3ba

Please sign in to comment.