# wrapNativeTokenInWallet() always reverts on Arbitrum

BendDAO's wrapNativeTokenInWallet uses WETH transferFrom from self, which reverts on Arbitrum's non-standard WETH, breaking BVault and cross-lending flows.

- Payout: Audit contest
- Severity: medium
- Program: BendDAO
- Found by: bin2chen
- Disclosed: 2024-09-03
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-07-benddao-findings/issues/42
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-05
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:dos

**Target:** Solidity VaultLogic WETH wrapping helper
**Root cause:** The helper calls IWETH.transferFrom(address(this), user, amount) after deposit; Arbitrum's WETH lacks the WETH9 src==msg.sender allowance bypass, so transferFrom from self without allowance reverts.
**Steps:**
1. Deploy/use BendDAO on Arbitrum with Arbitrum WETH (0x8b194...).
2. Call any function invoking VaultLogic.wrapNativeTokenInWallet with msg.value>0.
3. deposit{value:amount}() succeeds, then transferFrom(address(this), user, amount) reverts due to missing allowance.
4. Observe BVault/CrossLending flows fail.
**How found:** Code-reading of the helper's transferFrom usage, comparing against WETH9's src==msg.sender special case and noting Arbitrum's WETH implementation differs.
**Insight:** When a contract transfers its own wrapped-native balance, prefer transfer over transferFrom(self,...); WETH9's self-transfer allowance bypass is non-standard and absent on Arbitrum and other forks.

## Proof of concept (copied exactly from the original report)

**Vulnerable wrapNativeTokenInWallet using transferFrom**

```
function wrapNativeTokenInWallet(address wrappedNativeToken, address user, uint256 amount) internal {
    require(amount > 0, Errors.INVALID_AMOUNT);

    IWETH(wrappedNativeToken).deposit{value: amount}();

@>  bool success = IWETH(wrappedNativeToken).transferFrom(address(this), user, amount);
    require(success, Errors.TOKEN_TRANSFER_FAILED);
  }
```

**WETH9 src==msg.sender allowance handling**

```
if (src != msg.sender && allowance[src][msg.sender] != uint(- 1)) {
            require(allowance[src][msg.sender] >= wad);
            allowance[src][msg.sender] -= wad;
        }
```

