How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.
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.
The WHBAR contract is a key component of the SaucerSwap protocol, enabling the conversion of native HBAR into wrapped HBAR, and vice versa, thereby inheriting the HTS functionality needed to interact with smart contracts on Hedera.It is specifically designed to be called by the SaucerSwap V1 and V2 core and periphery contracts, as well as the WhbarHelper contract (described in this section). WHBAR is not intended for direct use by developers in other applications due to its specialized nature.
Accounts that use the WHBAR contract directly and meet the following risk conditions expose themselves to loss of funds. The vulnerability described in this notice has existed since a 2023 network update.For funds to be at risk, specific conditions must exist:
An account has an open WHBAR allowance granted outside of an atomic transaction.
The account is actively holding WHBAR tokens.
No protective mechanisms (like those used by SaucerSwap orΒ WhbarHelper contracts) are in place.
WHBAR and WhbarHelper IDs for mainnet and testnet.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SaucerSwap","description":"Official documentation for SaucerSwap, the decentralized exchange on the Hedera network: trading, liquidity, staking, developer guides, and API reference.","colors":{"primary":"#147638","light":"#44E760","dark":"#147638"},"logo":{"light":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/light.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=8c0ed1726e280507a5a5b4ccbd0a0b45","dark":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/dark.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=e35a01681c09c6ca20ca6537ee35f23e","href":"https://www.saucerswap.finance"},"favicon":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/favicon.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=fdb80b8e48d4b44fdfaf3886a3d793f4","api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python"]}},"appearance":{"default":"dark"},"background":{"decoration":"gradient","color":{"dark":"#060607"}},"navbar":{"links":[{"href":"https://saucerswap.finance/discord","label":"Discord","type":"discord"},{"href":"https://github.com/saucerswaplabs","label":"GitHub","type":"github"}],"primary":{"type":"button","label":"Launch app","href":"https://www.saucerswap.finance/swap"}},"footer":{"socials":{"x":"https://x.com/SaucerSwapLabs","discord":"https://saucerswap.finance/discord","github":"https://github.com/saucerswaplabs","youtube":"https://www.youtube.com/@saucerswap"}},"search":{"prompt":"Search SaucerSwap docs..."},"seo":{"indexing":"navigable"},"fonts":{"heading":{"family":"Euclid Triangle","weight":500,"source":"fonts/EuclidTriangle-Medium.woff2","format":"woff2"},"body":{"family":"Euclid Triangle","weight":400,"source":"fonts/EuclidTriangle-Regular.woff2","format":"woff2"}},"styling":{"codeblocks":"dark","latex":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page does not exist or has moved. Try the [docs home](/), the [swap tutorial](/tutorials/swap), or the [API reference](/api-reference/overview)."}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","mcp"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Launch app","icon":"rocket","href":"https://www.saucerswap.finance/swap"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"saucerswaplabs","hasAudioNarration":false,"actualSubdomain":"saucerswaplabs","customDomains":["docs.saucerswap.finance"],"gitSource":{"type":"github","owner":"saucerswaplabs","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae3b362885c3d00c9d224f0","collectionId":"39e694d9-4ae9-4bf7-91cc-61a3e65b0ad6","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae3b362885c3d00c9d224f0"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae3b362885c3d00c9d224f0","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"API Reference","count":53},{"language":"default","tag":"REST API","count":44},{"language":"default","tag":"Developers","count":41},{"language":"default","tag":"Tokens","count":18},{"language":"default","tag":"Liquidity","count":18},{"language":"default","tag":"Resources","count":17},{"language":"default","tag":"Learn","count":17},{"language":"default","tag":"Pools V1","count":14},{"language":"default","tag":"V1 guides","count":14},{"language":"default","tag":"V2 guides","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".chat-assistant-floating-input,chat-assistant-floating-input{display:none}"}],"page":{"pagePath":"developers/whbar/overview","slug":"/developers/whbar/overview","pageMetadata":{"title":"WHBAR overview","description":"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.","href":"/developers/whbar/overview"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,Heading,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(`div`,{style:{\"display\":`none`},children:_jsx(_components.p,{children:`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.`})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`π¨ Important Security Notice`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`DO NOT`}),` interact with the `,_jsx(_components.code,{children:`WHBAR`}),` contract directly.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`DO NOT`}),` grant allowances to the `,_jsx(_components.code,{children:`WHBAR`}),` contract.`]}),`\n`,_jsxs(_components.li,{children:[`You `,_jsx(_components.strong,{children:`MUST`}),` use the `,_jsx(_components.code,{children:`WhbarHelper`}),` contract instead.`]}),`\n`]}),_jsx(_components.p,{children:`WHBAR is not intended for direct use in other applications. Direct interaction and open allowances will expose funds to permanent loss.`})]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/developers/contracts`,children:`WHBAR contract`}),` is a key component of the SaucerSwap protocol, enabling the conversion of native HBAR into wrapped HBAR, and vice versa, thereby inheriting the HTS functionality needed to interact with smart contracts on Hedera.`]}),`\n`,_jsx(_components.p,{children:`It is specifically designed to be called by the SaucerSwap V1 and V2 core and periphery contracts, as well as the WhbarHelper contract (described in this section). WHBAR is not intended for direct use by developers in other applications due to its specialized nature.`}),`\n`,_jsx(Heading,{level:`2`,id:`whbar-contract-security-advisory`,children:`WHBAR contract security advisory`}),`\n`,_jsx(_components.p,{children:`Accounts that use the WHBAR contract directly and meet the following risk conditions expose themselves to loss of funds. The vulnerability described in this notice has existed since a 2023 network update.`}),`\n`,_jsx(_components.p,{children:`For funds to be at risk, specific conditions must exist:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`An account has an open WHBAR allowance granted outside of an atomic transaction.`}),`\n`,_jsx(_components.li,{children:`The account is actively holding WHBAR tokens.`}),`\n`,_jsxs(_components.li,{children:[`No protective mechanisms (like those used by SaucerSwap or\\xA0`,_jsx(_components.a,{href:`/developers/whbar/overview`,children:`WhbarHelper contracts`}),`) are in place.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For more information, see the `,_jsx(_components.a,{href:`https://www.saucerswap.finance/blog/whbar-contract-securityadvisory`,children:`WHBAR contract security advisory`}),` blog post.`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Wrap HBAR for WHBAR`,href:`/developers/whbar/wrap-hbar-for-whbar`,children:_jsx(_components.p,{children:`Deposit HBAR and receive WHBAR at 1:1.`})}),_jsx(Card,{title:`Unwrap WHBAR for HBAR`,href:`/developers/whbar/unwrap-whbar-for-hbar`,children:_jsx(_components.p,{children:`Withdraw WHBAR back to native HBAR.`})}),_jsx(Card,{title:`Contract deployments`,href:`/developers/contracts`,children:_jsx(_components.p,{children:`WHBAR and WhbarHelper IDs for mainnet and testnet.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"WHBAR overview","description":"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.","href":"/developers/whbar/overview"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"WHBAR contract security advisory","slug":"whbar-contract-security-advisory","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"saucerswaplabs","siteName":"SaucerSwap","title":"WHBAR overview - SaucerSwap","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-02T14:55:58.826Z","originalFileLocation":"developers/whbar/overview.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\">\u003cmeta data-mint-head name=\"application-name\" content=\"SaucerSwap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"WHBAR overview - SaucerSwap\">\u003cmeta data-mint-head property=\"og:description\" content=\"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SaucerSwap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.saucerswap.finance/developers/whbar/overview\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://saucerswaplabs.mintlify.app/_mintlify/api/og/v2?division=WHBAR\u0026amp;title=WHBAR+overview\u0026amp;description=How+the+WHBAR+and+WhbarHelper+contracts+wrap+HBAR+for+smart+contract+use+on+SaucerSwap%2C+plus+the+WHBAR+allowance+security+advisory+for+integrators.\u0026amp;theme=31eaf7d6f83325014d7de119\u0026amp;signature=5cdec409f9b190b5f8eb76379e6dbdfc0734f3ec99467ca10311973084b88869\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"WHBAR overview - SaucerSwap\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://saucerswaplabs.mintlify.app/_mintlify/api/og/v2?division=WHBAR\u0026amp;title=WHBAR+overview\u0026amp;description=How+the+WHBAR+and+WhbarHelper+contracts+wrap+HBAR+for+smart+contract+use+on+SaucerSwap%2C+plus+the+WHBAR+allowance+security+advisory+for+integrators.\u0026amp;theme=31eaf7d6f83325014d7de119\u0026amp;signature=5cdec409f9b190b5f8eb76379e6dbdfc0734f3ec99467ca10311973084b88869\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SaucerSwap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#147638\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.saucerswap.finance/developers/whbar/overview\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developers/whbar/overview.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.saucerswap.finance/#organization\",\"name\":\"SaucerSwap\",\"url\":\"https://docs.saucerswap.finance\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/light.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=8c0ed1726e280507a5a5b4ccbd0a0b45\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.saucerswap.finance#website\",\"name\":\"SaucerSwap\",\"url\":\"https://docs.saucerswap.finance\",\"publisher\":{\"@id\":\"https://docs.saucerswap.finance/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.saucerswap.finance/developers/whbar/overview#webpage\",\"url\":\"https://docs.saucerswap.finance/developers/whbar/overview\",\"name\":\"WHBAR overview\",\"description\":\"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\",\"dateModified\":\"2026-09-02T14:55:58.826Z\",\"isPartOf\":{\"@id\":\"https://docs.saucerswap.finance#website\"},\"breadcrumb\":{\"@id\":\"https://docs.saucerswap.finance/developers/whbar/overview#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.saucerswap.finance/developers/whbar/overview#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"More guides\",\"item\":\"https://docs.saucerswap.finance/developers/staking/single-sided-staking\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WHBAR overview\",\"item\":\"https://docs.saucerswap.finance/developers/whbar/overview\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.saucerswap.finance/developers/whbar/overview#article\",\"headline\":\"WHBAR overview\",\"name\":\"WHBAR overview\",\"description\":\"How the WHBAR and WhbarHelper contracts wrap HBAR for smart contract use on SaucerSwap, plus the WHBAR allowance security advisory for integrators.\",\"url\":\"https://docs.saucerswap.finance/developers/whbar/overview\",\"mainEntityOfPage\":{\"@id\":\"https://docs.saucerswap.finance/developers/whbar/overview#webpage\"},\"dateModified\":\"2026-09-02T14:55:58.826Z\",\"publisher\":{\"@id\":\"https://docs.saucerswap.finance/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.saucerswap.finance#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SaucerSwap\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SaucerSwap","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Launch app","icon":"rocket","href":"https://www.saucerswap.finance/swap"}]},"tabs":[{"tab":"Learn","icon":"graduation-cap","pages":[{"title":"Learn","href":""}]},{"tab":"Protocol","icon":"diagram-project","pages":[{"title":"Protocol","href":"/protocol/overview"}]},{"tab":"Developers","icon":"code","groups":[{"group":"Getting started","pages":[{"title":"Developer overview","href":"/developers/overview"},{"title":"Developer quickstart","href":"/developers/quickstart"},{"title":"Contract deployments","href":"/developers/contracts"}]},{"group":"V1 guides","pages":[{"group":"Swap","pages":[{"title":"Swap quote (V1)","href":"/developers/v1/swap/swap-quote"},{"title":"Swap HBAR for tokens (V1)","href":"/developers/v1/swap/swap-hbar-for-tokens"},{"title":"Swap tokens for HBAR (V1)","href":"/developers/v1/swap/swap-tokens-for-hbar"},{"title":"Swap tokens for tokens (V1)","href":"/developers/v1/swap/swap-tokens-for-tokens"},{"title":"Track swap events (V1)","href":"/developers/v1/swap/track-swap-events"}]},{"group":"Liquidity","pages":[{"title":"V1 liquidity operations","href":"/developers/v1/liquidity/overview"},{"title":"Adding liquidity (V1)","href":"/developers/v1/liquidity/adding-liquidity"},{"title":"Removing liquidity (V1)","href":"/developers/v1/liquidity/removing-liquidity"},{"title":"Create a new pool (V1)","href":"/developers/v1/liquidity/create-a-new-pool"},{"title":"Check if a pool exists (V1)","href":"/developers/v1/liquidity/check-if-a-pool-exists"},{"title":"Fetch all pools (V1)","href":"/developers/v1/liquidity/fetch-all-pools"},{"title":"Get pool reserves (V1)","href":"/developers/v1/liquidity/get-pool-reserves"},{"title":"Pool creation fee (V1)","href":"/developers/v1/liquidity/pool-creation-fee"},{"title":"Track pool updates (V1)","href":"/developers/v1/liquidity/track-pool-updates"}]}]},{"group":"V2 guides","pages":[{"group":"Swap","pages":[{"title":"Swap quote (V2)","href":"/developers/v2/swap/swap-quote"},{"title":"Swap HBAR for tokens (V2)","href":"/developers/v2/swap/swap-hbar-for-tokens"},{"title":"Swap tokens for HBAR (V2)","href":"/developers/v2/swap/swap-tokens-for-hbar"},{"title":"Swap tokens for tokens (V2)","href":"/developers/v2/swap/swap-tokens-for-tokens"},{"title":"Track swap events (V2)","href":"/developers/v2/swap/track-swap-events"}]},{"group":"Liquidity","pages":[{"title":"New liquidity position (V2)","href":"/developers/v2/liquidity/new-liquidity-position"},{"title":"Increasing liquidity (V2)","href":"/developers/v2/liquidity/increasing-liquidity"},{"title":"Decreasing liquidity (V2)","href":"/developers/v2/liquidity/decreasing-liquidity"},{"title":"Claiming fees (V2)","href":"/developers/v2/liquidity/claiming-fees"},{"title":"Get user positions (V2)","href":"/developers/v2/liquidity/get-user-positions"},{"title":"Liquidity position fee (V2)","href":"/developers/v2/liquidity/liquidity-position-fee"},{"title":"Fetch all pools (V2)","href":"/developers/v2/liquidity/fetch-all-pools"},{"title":"Fetch pool token ratio (V2)","href":"/developers/v2/liquidity/fetch-pool-token-ratio"},{"title":"Check if a pool exists (V2)","href":"/developers/v2/liquidity/check-if-a-pool-exists"}]}]},{"group":"V3 order book","tag":"NEW","pages":[{"title":"TypeScript bot client","href":"/developers/orderbook/typescript-client"}]},{"group":"More guides","pages":[{"group":"Staking","pages":[{"title":"Single-sided staking operations","href":"/developers/staking/single-sided-staking"},{"title":"Yield farming operations","description":"Contract operations for SaucerSwap yield farms: deposit and withdraw LP tokens and read pending SAUCE and HBAR rewards from the Masterchef contract.","href":"/developers/staking/yield-farming"}]},{"group":"WHBAR","pages":[{"title":"WHBAR overview","href":"/developers/whbar/overview"},{"title":"Wrap HBAR for WHBAR","description":"Wrap native HBAR into WHBAR tokens at a 1:1 ratio through the WhbarHelper deposit function, with token association requirements and a code example.","href":"/developers/whbar/wrap-hbar-for-whbar"},{"title":"Unwrap WHBAR for HBAR","href":"/developers/whbar/unwrap-whbar-for-hbar"}]},{"title":"SaucerSwap Widget","href":"/widget"}]},{"group":"Security","pages":[{"title":"Security audits","href":"/developers/security/audits"},{"title":"Bug bounty","href":"/developers/security/bug-bounty"}]},{"group":"AI","pages":[{"title":"Build with AI","href":"/developers/ai"}]}]},{"tab":"API Reference","icon":"brackets-curly","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Resources","icon":"box-archive","pages":[{"title":"Resources","href":"/resources/for-projects"}]}]},"title":"WHBAR overview - SaucerSwap","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":[],"chunks":[]}