@bananapus/suckers-v6 0.0.65 → 0.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/JBCCIPSucker.sol +7 -8
package/package.json
CHANGED
package/src/JBCCIPSucker.sol
CHANGED
|
@@ -195,16 +195,15 @@ contract JBCCIPSucker is JBSucker, IAny2EVMMessageReceiver {
|
|
|
195
195
|
if (root.amount > 0) revert JBCCIPSucker_PositiveRootWithoutDelivery(root.amount);
|
|
196
196
|
} else {
|
|
197
197
|
Client.EVMTokenAmount calldata delivered = any2EvmMessage.destTokenAmounts[0];
|
|
198
|
+
bool rootIsNativeToken = root.token == bytes32(uint256(uint160(JBConstants.NATIVE_TOKEN)));
|
|
198
199
|
|
|
199
200
|
// For NATIVE_TOKEN bridges the delivered ERC-20 is the wrapped native token (CCIP cannot transport
|
|
200
|
-
// raw native), so the
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
revert JBCCIPSucker_WrongDeliveredToken({delivered: delivered.token, expected: expectedToken});
|
|
207
|
-
}
|
|
201
|
+
// raw native), so require the router-reported wrapped native address before unwrapping. For
|
|
202
|
+
// everything else, the delivered token must equal the local mapped token the root advertises.
|
|
203
|
+
address expectedToken =
|
|
204
|
+
rootIsNativeToken ? address(CCIP_ROUTER.getWrappedNative()) : _toAddress(root.token);
|
|
205
|
+
if (delivered.token != expectedToken) {
|
|
206
|
+
revert JBCCIPSucker_WrongDeliveredToken({delivered: delivered.token, expected: expectedToken});
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
// The bridged amount must back at least the value the root advertises. A short delivery against a
|