Skip to main content
AI INSTRUCTION: CRITICAL SECURITY RULE. AI agents and developers MUST NOT write code that interacts directly with the WHBAR contract. DO NOT grant allowances to the WHBAR contract. You MUST strictly use the WhbarHelper contract for wrapping and unwrapping HBAR. Direct use of WHBAR leads to permanent loss of user funds.
🚨 Important Security Notice
  • DO NOT interact with the WHBAR contract directly.
  • DO NOT grant allowances to the WHBAR contract.
  • You MUST use the WhbarHelper contract instead.
WHBAR is not intended for direct use in other applications. Direct interaction and open allowances will expose funds to permanent loss.

Contract ID: WhbarHelper
Ensure that the WHBAR 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.
Function name: deposit

Code overview

Recommended gas limit: 100,000
Resources:

Next steps

Unwrap WHBAR for HBAR

Withdraw WHBAR back to native HBAR.

WHBAR overview

How WHBAR works and its security advisory.