@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/suckers-v6",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 token-identity check happens inside `unwrapReceivedTokens` against the
201
- // router-reported wrapped native address. For everything else, the delivered token must equal the
202
- // local mapped token the root advertises.
203
- if (root.token != bytes32(uint256(uint160(JBConstants.NATIVE_TOKEN)))) {
204
- address expectedToken = _toAddress(root.token);
205
- if (delivered.token != expectedToken) {
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