@@ -118,9 +118,6 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv
118
118
119
119
//--- IBC Packet Callbacks ---//
120
120
121
- // packet.srcPortAddr is the IncentivizedPolymerEscrow address on the source chain.
122
- // packet.destPortAddr is the address of this contract.
123
- // channelId: the channel id from the running chain's perspective, which can be used to identify the counterparty chain.
124
121
function onRecvPacket (IbcPacket calldata packet )
125
122
external override
126
123
onlyIbcDispatcher
@@ -129,12 +126,12 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv
129
126
uint256 gasLimit = gasleft ();
130
127
bytes32 feeRecipitent = bytes32 (uint256 (uint160 (tx .origin )));
131
128
132
- // Collect the implementation identifier we added. Remember, this is trusted IFF packet.src .channelId is trusted.
129
+ // Collect the implementation identifier we added. Remember, this is trusted IFF packet.dest .channelId is trusted.
133
130
// sourceImplementationIdentifier has already been defined by the channel on channel creation.
134
131
bytes memory sourceImplementationIdentifier = packet.data[POLYMER_SENDER_IDENTIFIER_START:POLYMER_SENDER_IDENTIFIER_END];
135
132
136
133
bytes memory receiveAck = _handleMessage (
137
- packet.src .channelId,
134
+ packet.dest .channelId,
138
135
sourceImplementationIdentifier,
139
136
packet.data[POLYMER_PACKAGE_PAYLOAD_START: ],
140
137
feeRecipitent,
@@ -155,18 +152,18 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv
155
152
uint256 gasLimit = gasleft ();
156
153
bytes32 feeRecipitent = bytes32 (uint256 (uint160 (tx .origin )));
157
154
158
- // Collect the implementation identifier we added. Remember, this is trusted IFF packet.src .channelId is trusted.
155
+ // Collect the implementation identifier we added. Remember, this is trusted IFF packet.dest .channelId is trusted.
159
156
bytes memory destinationImplementationIdentifier = ack.data[POLYMER_SENDER_IDENTIFIER_START:POLYMER_SENDER_IDENTIFIER_END];
160
157
161
158
// Get the payload by removing the implementation identifier.
162
159
bytes calldata rawMessage = ack.data[POLYMER_PACKAGE_PAYLOAD_START:];
163
160
164
161
// Set a verificaiton context so we can recover the ack.
165
162
isVerifiedMessageHash[keccak256 (rawMessage)] = VerifiedMessageHashContext ({
166
- chainIdentifier: packet.src .channelId,
163
+ chainIdentifier: packet.dest .channelId,
167
164
implementationIdentifier: destinationImplementationIdentifier
168
165
});
169
- _handleAck (packet.src .channelId, destinationImplementationIdentifier, rawMessage, feeRecipitent, gasLimit);
166
+ _handleAck (packet.dest .channelId, destinationImplementationIdentifier, rawMessage, feeRecipitent, gasLimit);
170
167
}
171
168
172
169
function onTimeoutPacket (IbcPacket calldata packet ) external override onlyIbcDispatcher{
@@ -178,7 +175,7 @@ contract IncentivizedPolymerEscrow is APolymerEscrow, IbcReceiverBase, IbcReceiv
178
175
bytes32 messageIdentifier = bytes32 (rawMessage[MESSAGE_IDENTIFIER_START:MESSAGE_IDENTIFIER_END]);
179
176
address fromApplication = address (uint160 (bytes20 (rawMessage[FROM_APPLICATION_START_EVM:FROM_APPLICATION_END])));
180
177
_handleTimeout (
181
- packet.src .channelId, messageIdentifier, fromApplication, rawMessage[CTX0_MESSAGE_START:], feeRecipitent, gasLimit
178
+ packet.dest .channelId, messageIdentifier, fromApplication, rawMessage[CTX0_MESSAGE_START:], feeRecipitent, gasLimit
182
179
);
183
180
}
184
181
0 commit comments