Let another account or contract move FHERC20 tokens for a holder until a deadline
An operator is an address that may move any amount of a holder’s tokens until a deadline. FHERC20 has no per-amount allowance, so operators are how a holder lets someone else spend: a payment app, a vault, or a second wallet.
Each call replaces the previous deadline for that pair, so the same call extends or shortens it. To revoke, set until to 0:
await token.setOperator(operatorAddress, 0);
Every call emits OperatorSet(holder, operator, until).isOperator(holder, spender) returns true while block.timestamp <= until, so the deadline second itself is still valid. A holder is always its own operator.
An operator can move the holder’s whole balance, in any number of transfers, until the deadline. There is no amount cap. Grant the shortest window that covers the task, and revoke it when the task is done.
The operator encrypts the amount with its own SDK client and sends the transaction itself. An input encrypted by the holder fails with InvalidSigner when the operator submits it, because the proof is bound to the sender.
A balance that is too low moves zero, as with any transfer. The operator does not learn the holder’s balance from the result unless it is the recipient.
A contract that pulls tokens from users, such as a vault, must be an operator for each user. The user calls setOperator(vaultAddress, until) before calling the vault. The vault then calls the sharedEuint64 form of confidentialTransferFrom, and msg.sender in the token is the vault.Call a token from your contract has a complete vault that deposits and withdraws this way.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Fhenix Documentation","description":"Documentation for Fhenix products: CoFHE and the Wallet Module.","colors":{"primary":"#0AD9DC","light":"#5FE8EA","dark":"#089EA1"},"logo":{"light":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/light.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=305de5e4f0ced7831f511f54c3836db2","dark":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/dark.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=85c3ae8ba2fc56ae4f71b99ff75cfefe"},"favicon":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/favicon.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=1d44b00f5eeec228c407208538172b90","navbar":{"links":[{"icon":"github","href":"https://github.com/fhenixprotocol/","label":"Github"}],"primary":{"type":"button","label":"support","href":"https://t.me/+OEO4CItQYh8xYzNh"}},"footer":{"socials":{"x":"https://x.com/fhenix","github":"https://github.com/fhenixprotocol","discord":"https://discord.com/invite/FuVgxrvJMY"}},"seo":{"metatags":{"og:site_name":"Fhenix Documentation","og:type":"website","twitter:card":"summary","twitter:site":"@fhenix"}},"integrations":{"ga4":{"measurementId":"G-NKHXME4286"}},"contextual":{"options":["copy","chatgpt","claude","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fhenix","hasAudioNarration":false,"actualSubdomain":"fhenix","customDomains":["cofhe-docs.fhenix.zone","docs.fhenix.io"],"gitSource":{"type":"github","owner":"fhenixprotocol","repo":"fhenix-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae36a4f878abd4f8baebabe","collectionId":"6fea768d-61a0-4383-aa70-4b1aea5b7f81","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae36a4f878abd4f8baebabe"},"feedback":{"thumbs":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae36a4f878abd4f8baebabe","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"CoFHE","count":106},{"language":"default","tag":"FHE library","count":43},{"language":"default","tag":"Client SDK","count":36},{"language":"default","tag":"Wallet Module","count":18},{"language":"default","tag":"Reference","count":15},{"language":"default","tag":"Deep Dive","count":15},{"language":"default","tag":"Confidential Contracts","count":15},{"language":"default","tag":"Introduction","count":13},{"language":"default","tag":"Core Concepts","count":12},{"language":"default","tag":"Use the wallet","count":12}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"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":"rbac-expansion","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":"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":"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":"full-page-search","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":"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":"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":"turbopuffer-dual-write","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},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cofhe/fhe-library/confidential-contracts/fherc20/operators","slug":"/cofhe/fhe-library/confidential-contracts/fherc20/operators","pageMetadata":{"title":"Operators","description":"Let another account or contract move FHERC20 tokens for a holder until a deadline","href":"/cofhe/fhe-library/confidential-contracts/fherc20/operators"},"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: \"Let another account or contract move FHERC20 tokens for a holder until a deadline\"\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`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`An operator is an address that may move any amount of a holder’s tokens until a deadline. FHERC20 has no per-amount allowance, so operators are how a holder lets someone else spend: a payment app, a vault, or a second wallet.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-do-you-grant-and-revoke-an-operator`,children:`How do you grant and revoke an operator?`}),`\n`,_jsxs(_components.p,{children:[`The holder calls `,_jsx(_components.code,{children:`setOperator(address operator, uint48 until)`}),`, where `,_jsx(_components.code,{children:`until`}),` is a Unix timestamp in seconds:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getBlock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'latest'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setOperator`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`operatorAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timestamp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3600`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Each call replaces the previous deadline for that pair, so the same call extends or shortens it. To revoke, set `,_jsx(_components.code,{children:`until`}),` to `,_jsx(_components.code,{children:`0`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setOperator`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`operatorAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Every call emits `,_jsx(_components.code,{children:`OperatorSet(holder, operator, until)`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`isOperator(holder, spender)`}),` returns `,_jsx(_components.code,{children:`true`}),` while `,_jsx(_components.code,{children:`block.timestamp \u003c= until`}),`, so the deadline second itself is still valid. A holder is always its own operator.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`An operator can move the holder’s whole balance, in any number of transfers, until the deadline. There is no amount cap. Grant the shortest window that covers the task, and revoke it when the task is done.`})}),`\n`,_jsx(Heading,{level:`2`,id:`what-can-an-operator-call`,children:`What can an operator call?`}),`\n`,_jsxs(_components.p,{children:[`Operator rights apply to every function that takes a `,_jsx(_components.code,{children:`from`}),` address:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`confidentialTransferFrom`}),`, in both the wallet and the contract form. See `,_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/fherc20/core-features#which-transfer-function-do-you-call`,children:`transfers`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`confidentialTransferFromAndCall`}),`. See `,_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/fherc20/transfer-callbacks`,children:`transfer callbacks`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`unshield(from, to, amount)`}),` on the `,_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/fherc20/fherc20-wrapper`,children:`wrappers`}),`, which sends the underlying tokens to any `,_jsx(_components.code,{children:`to`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A caller that is not an operator for `,_jsx(_components.code,{children:`from`}),` gets `,_jsx(_components.code,{children:`FHERC20UnauthorizedSpender(holder, spender)`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-does-an-operator-transfer-from-a-wallet`,children:`How does an operator transfer from a wallet?`}),`\n`,_jsxs(_components.p,{children:[`The operator encrypts the amount with its own SDK client and sends the transaction itself. An input encrypted by the holder fails with `,_jsx(_components.code,{children:`InvalidSigner`}),` when the operator submits it, because the proof is bound to the sender.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Encryptable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@cofhe/sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`inputProof`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` operatorClient`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`encryptInputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Encryptable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`uint64`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setConsumingContract`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`operatorSigner`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'confidentialTransferFrom(address,address,bytes32,bytes)'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`holder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`recipient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`inputProof`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`A balance that is too low moves zero, as with any transfer. The operator does not learn the holder’s balance from the result unless it is the recipient.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-does-a-contract-act-as-an-operator`,children:`How does a contract act as an operator?`}),`\n`,_jsxs(_components.p,{children:[`A contract that pulls tokens from users, such as a vault, must be an operator for each user. The user calls `,_jsx(_components.code,{children:`setOperator(vaultAddress, until)`}),` before calling the vault. The vault then calls the `,_jsx(_components.code,{children:`sharedEuint64`}),` form of `,_jsx(_components.code,{children:`confidentialTransferFrom`}),`, and `,_jsx(_components.code,{children:`msg.sender`}),` in the token is the vault.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/calling-from-contracts`,children:`Call a token from your contract`}),` has a complete vault that deposits and withdraws this way.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-pages`,children:`Related pages`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/fherc20/core-features`,children:`Transfers and disclosure`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cofhe/fhe-library/confidential-contracts/fherc20/best-practices`,children:`Best practices`})}),`\n`]})]})}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":{"config":{},"pageMetadata":{"title":"Operators","description":"Let another account or contract move FHERC20 tokens for a holder until a deadline","href":"/cofhe/fhe-library/confidential-contracts/fherc20/operators"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How do you grant and revoke an operator?","slug":"how-do-you-grant-and-revoke-an-operator","depth":2,"children":[]},{"title":"What can an operator call?","slug":"what-can-an-operator-call","depth":2,"children":[]},{"title":"How does an operator transfer from a wallet?","slug":"how-does-an-operator-transfer-from-a-wallet","depth":2,"children":[]},{"title":"How does a contract act as an operator?","slug":"how-does-a-contract-act-as-an-operator","depth":2,"children":[]},{"title":"Related pages","slug":"related-pages","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fhenix","siteName":"Fhenix Documentation","title":"Operators - Fhenix Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-14T10:26:44.696Z","originalFileLocation":"cofhe/fhe-library/confidential-contracts/fherc20/operators.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=\"system\"}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=\"Let another account or contract move FHERC20 tokens for a holder until a deadline\">\u003cmeta data-mint-head name=\"application-name\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Operators - Fhenix Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Let another account or contract move FHERC20 tokens for a holder until a deadline\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fhenix.mintlify.app/_mintlify/api/og/v2?division=FHERC20\u0026amp;title=Operators\u0026amp;description=Let+another+account+or+contract+move+FHERC20+tokens+for+a+holder+until+a+deadline\u0026amp;theme=b7e140db94e370d559b9133f\u0026amp;signature=a1bee141ce351a3458ad4504ea18ed86ffe723f17fbca8a24b4c2cae8431cad0\">\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=\"Operators - Fhenix Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Let another account or contract move FHERC20 tokens for a holder until a deadline\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fhenix.mintlify.app/_mintlify/api/og/v2?division=FHERC20\u0026amp;title=Operators\u0026amp;description=Let+another+account+or+contract+move+FHERC20+tokens+for+a+holder+until+a+deadline\u0026amp;theme=b7e140db94e370d559b9133f\u0026amp;signature=a1bee141ce351a3458ad4504ea18ed86ffe723f17fbca8a24b4c2cae8431cad0\">\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/fhenix/6My8uy_iS97zuzuy/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0AD9DC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cofhe/fhe-library/confidential-contracts/fherc20/operators.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\",\"name\":\"Fhenix Documentation\",\"url\":\"https://cofhe-docs.fhenix.zone\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/light.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=305de5e4f0ced7831f511f54c3836db2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://cofhe-docs.fhenix.zone#website\",\"name\":\"Fhenix Documentation\",\"url\":\"https://cofhe-docs.fhenix.zone\",\"publisher\":{\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators#webpage\",\"url\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators\",\"name\":\"Operators\",\"description\":\"Let another account or contract move FHERC20 tokens for a holder until a deadline\",\"dateModified\":\"2026-10-14T10:26:44.696Z\",\"isPartOf\":{\"@id\":\"https://cofhe-docs.fhenix.zone#website\"},\"breadcrumb\":{\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Confidential Contracts\",\"item\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FHERC20\",\"item\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Operators\",\"item\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators#article\",\"headline\":\"Operators\",\"name\":\"Operators\",\"description\":\"Let another account or contract move FHERC20 tokens for a holder until a deadline\",\"url\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators\",\"mainEntityOfPage\":{\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/fhe-library/confidential-contracts/fherc20/operators#webpage\"},\"dateModified\":\"2026-10-14T10:26:44.696Z\",\"publisher\":{\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\"},\"isPartOf\":{\"@id\":\"https://cofhe-docs.fhenix.zone#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Fhenix Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Fhenix Documentation","nav":{"global":null,"products":[{"product":"All products","icon":"grid-2","pages":[{"title":"All products","href":""}]},{"product":"CoFHE","icon":"lock","tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":"/cofhe"}]},{"tab":"Client SDK","pages":[{"title":"Client SDK","href":"/cofhe/client-sdk/introduction/overview"}]},{"tab":"FHE library","groups":[{"group":"Introduction","pages":[{"title":"Overview","href":"/cofhe/fhe-library/introduction/overview"},{"title":"Quick Start","href":"/cofhe/fhe-library/introduction/quick-start"},{"title":"Best Practices","href":"/cofhe/fhe-library/introduction/best-practices"}]},{"group":"Core Concepts","pages":[{"title":"Inputs","href":"/cofhe/fhe-library/core-concepts/inputs"},{"title":"Handles, wrap, and unwrap","href":"/cofhe/fhe-library/core-concepts/handles"},{"title":"Trivial Encryption","href":"/cofhe/fhe-library/core-concepts/trivial-encryption"},{"title":"Data Evaluation","href":"/cofhe/fhe-library/core-concepts/data-evaluation"},{"title":"FHE Encrypted Operations","href":"/cofhe/fhe-library/core-concepts/encrypted-operations"},{"title":"Conditions (if .. else)","href":"/cofhe/fhe-library/core-concepts/conditions"},{"title":"Require","href":"/cofhe/fhe-library/core-concepts/require"},{"title":"Access Control","href":"/cofhe/fhe-library/core-concepts/access-control"},{"title":"Decryption Operations","href":"/cofhe/fhe-library/core-concepts/decryption-operations"},{"title":"Randomness","href":"/cofhe/fhe-library/core-concepts/randomness"},{"title":"Gas Costs and Benchmarks","href":"/cofhe/fhe-library/core-concepts/gas-and-benchmarks"},{"title":"Common Errors","href":"/cofhe/fhe-library/core-concepts/common-errors"}]},{"group":"Confidential Contracts","pages":[{"title":"Overview","href":"/cofhe/fhe-library/confidential-contracts/overview"},{"title":"Call a token from your contract","href":"/cofhe/fhe-library/confidential-contracts/calling-from-contracts"},{"title":"Upgradeable tokens","href":"/cofhe/fhe-library/confidential-contracts/upgradeable"},{"group":"FHERC20","pages":[{"title":"Overview","href":"/cofhe/fhe-library/confidential-contracts/fherc20/overview"},{"title":"Transfers and disclosure","description":"Send FHERC20 tokens from a wallet or a contract, read what moved, and make an encrypted amount public","href":"/cofhe/fhe-library/confidential-contracts/fherc20/core-features"},{"title":"Operators","href":"/cofhe/fhe-library/confidential-contracts/fherc20/operators"},{"title":"Transfer callbacks","description":"Send FHERC20 tokens to a contract and let it accept or refund them in the same transaction","href":"/cofhe/fhe-library/confidential-contracts/fherc20/transfer-callbacks"},{"title":"Wrap ERC-20 tokens and ETH","href":"/cofhe/fhe-library/confidential-contracts/fherc20/fherc20-wrapper"},{"title":"FHERC20 best practices","href":"/cofhe/fhe-library/confidential-contracts/fherc20/best-practices"}]},{"group":"ERC20Confidential","pages":[{"title":"Overview","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/overview"},{"title":"How the two balances relate","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/dual-balance-model"},{"title":"Shield and unshield","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/shield-unshield"},{"title":"Confidential transfers and operators","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/confidential-operations"},{"title":"Extend ERC20Confidential","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/extending"},{"title":"ERC20Confidential best practices","href":"/cofhe/fhe-library/confidential-contracts/dual-mode/best-practices"}]}]},{"group":"Examples","pages":[{"title":"Encrypted Auction Example","href":"/cofhe/fhe-library/examples/auction-example"}]},{"group":"Reference","pages":[{"group":"FHE.sol","pages":[{"title":"FHE.sol Overview","href":"/cofhe/fhe-library/reference/fhe-sol/overview"},{"title":"Type Conversion","href":"/cofhe/fhe-library/reference/fhe-sol/type-conversion"},{"title":"Arithmetic Operations","href":"/cofhe/fhe-library/reference/fhe-sol/arithmetic"},{"title":"Bitwise Operations","href":"/cofhe/fhe-library/reference/fhe-sol/bitwise"},{"title":"Comparison Operations","href":"/cofhe/fhe-library/reference/fhe-sol/comparison"},{"title":"Decryption","href":"/cofhe/fhe-library/reference/fhe-sol/decryption"},{"title":"Access Control","href":"/cofhe/fhe-library/reference/fhe-sol/access-control"},{"title":"Utility Functions","href":"/cofhe/fhe-library/reference/fhe-sol/utility"},{"title":"Bindings (Dot Notation)","href":"/cofhe/fhe-library/reference/fhe-sol/bindings"}]},{"title":"Gas per Operation","href":"/cofhe/fhe-library/reference/gas-costs"},{"title":"CoFHE Errors Package","href":"/cofhe/fhe-library/reference/cofhe-errors"},{"title":"Error Reference","href":"/cofhe/fhe-library/reference/cofhe-errors-reference"}]}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/cofhe/tutorials/overview"}]},{"tab":"Deep Dive","pages":[{"title":"Deep Dive","href":"/cofhe/deep-dive/cofhe-components/overview"}]}]},{"product":"Wallet Module","icon":"wallet","pages":[{"title":"Wallet Module","href":"/wallet"}]},{"product":"Trading","icon":"chart-line","pages":[{"title":"Trading","href":"/trading"}]}]},"basePath":"","title":"Operators - Fhenix Documentation","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":[],"chunks":[]}