> ## Documentation Index
> Fetch the complete documentation index at: https://docs.saucerswap.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Wrap HBAR for WHBAR

> Deposit HBAR native cryptocurrency to retrieve Wrapped HBAR (WHBAR) tokens at a 1:1 ratio

<Info>
  Contract ID: [WhbarHelper](https://hashscan.io/mainnet/contract/0.0.5808826)
</Info>

<Warning>
  Ensure that the [**WHBAR**](https://hashscan.io/mainnet/token/0.0.1456986)  \*\*\*\*token ID is associated with the account prior to calling the deposit function. Failure to do so will result in a `TOKEN_NOT_ASSOCIATED_TO_ACCOUNT` error
</Warning>

Function name: **deposit**

<CodeGroup>
  ```solidity WhbarHelper.sol theme={null}
  function deposit() public payable {
    IWHBAR(whbarContract).deposit{value: msg.value}(msg.sender, msg.sender);
  }
  ```
</CodeGroup>

### Code Overview

⛽ *Recommended gas: 100,000 gwei (\~ \$0.009 USD)*

<Tabs>
  <Tab title="JavaScript SDK">
    **Resources:**

    * [SaucerSwap deployed contract IDs](/developerx/contract-deployments)
    * [Hedera JavaScript SDK](https://github.com/hashgraph/hedera-sdk-js)
    * [Associate tokens to an account](https://docs.hedera.com/hedera/sdks-and-apis/sdks/token-service/associate-tokens-to-an-account)
    * [Calling a smart contract function](https://docs.hedera.com/hedera/sdks-and-apis/sdks/smart-contracts/call-a-smart-contract-function)

    ```typescript Typescript theme={null}
    import { 
      ContractExecuteTransaction,
      TokenAssociateTransaction,
      Hbar,
      HbarUnit,  
      .. 
    } from '@hashgraph/sdk';

    //Client pre-checks:
    // - WHBAR token is associated

    const depositHbar = Hbar.from(depositAmount, HbarUnit.Hbar)
        
    await new ContractExecuteTransaction()
     .setContractId(whbarHelperContractId)
     .setPayableAmount(depositHbar)
     .setGas(gasLim)
     .setFunction('deposit')
     .execute(client);
    ```
  </Tab>
</Tabs>
