How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.
State sync is the mechanism by which contract state on Ethereum is propagated to the Bor chain. It allows dApps on Polygon Chain to read and react to events that originate on Ethereum.
How state sync works
State transfer from Ethereum to Bor happens through a system call:
A contract on Ethereum calls syncState on the StateSender.sol contract, emitting a StateSynced event.
Heimdall validators listen for StateSynced events. One validator sends a state-sync transaction to Heimdall.
Once the transaction is included in a Heimdall block, it is added to the pending state-sync list.
After every sprint on Bor (currently 16 blocks), the Bor node fetches pending state-sync records from Heimdall via API.
Bor commits these records at the start of each sprint by calling onStateReceive on the target contract. This is a system call from address 2^160-2.
The receiver contract on Bor must implement IStateReceiver. The onStateReceive function can only be called by StateReceiver.sol at address 0x0000000000000000000000000000000000001001.
State sender contract
Source: StateSender.solThe StateSender contract on Ethereum exposes a syncState function:
contract StateSender { /** * Emits `stateSynced` events to start sync process on Ethereum chain * @param receiver Target contract on Bor chain * @param data Data to send */ function syncState ( address receiver, bytes calldata data ) external;}
Calling syncState emits the following event:
/** * Emits `stateSynced` events to start sync process on Ethereum chain * @param id State id * @param contractAddress Target contract address on Bor * @param data Data to send to Bor chain for Target contract address */event StateSynced ( uint256 indexed id, address indexed contractAddress, bytes data);
Once the StateSynced event is emitted, Heimdall listens for it. After 2/3+ validators agree, the state-sync record is added to Heimdall state. Bor fetches and applies it at the start of the next sprint.
State receiver interface on Bor
The target contract on Bor must implement the following interface:
// IStateReceiver represents interface to receive stateinterface IStateReceiver { function onStateReceive(uint256 stateId, bytes calldata data) external;}
Only StateReceiver.sol at address 0x0000000000000000000000000000000000001001 is permitted to call onStateReceive on target contracts.
Gas for receivers
Since the Uburu upgrade, StateReceiver gives each onStateReceive call a bounded amount of gas. It reads the amount from the StateSyncGasOracle contract at 0x5e3a5eafd4501332c0bc2acfd38df3ebc5152147, capped at 5,000,000. If the oracle cannot be read, it uses 160,000. At the time of writing, gasLimit() on the oracle returns 160,000 on mainnet. Governance can change this value, so read it from the oracle instead of hard-coding it:
If onStateReceive runs out of gas or reverts, the state sync is not lost. StateReceiver emits StateCommitted(stateId, false), stores a hash of the receiver address and the state data, and continues with the next record. Anyone can replay the failed state sync later.
Check whether a delivery failed
StateCommitted(uint256 indexed stateId, bool success) is emitted for every state sync delivered to a contract. A success value of false marks a failure. To check a specific state sync, read the stored hash:
A non-zero result means the state sync failed and has not been replayed. It is zero if the delivery succeeded, if the state sync was already replayed, or if the receiver was not a contract.
Replay a failed state sync
Call replayFailedStateSyncWithData on StateReceiver:
function replayFailedStateSyncWithData( uint256 stateId, address receiver, bytes calldata stateData) external;
The arguments are the id, contractAddress and data of the StateSynced event that the StateSender contract emitted on Ethereum. You can also read them from the state-sync record on Heimdall; see the clerk module. The contract checks that keccak256(abi.encode(receiver, stateData)) matches the stored hash.
The replay is not limited by the oracle. The receiver gets the gas your transaction provides, so set a --gas-limit that is enough for onStateReceive.
If the receiver reverts again, the whole replay transaction reverts and the stored hash is kept, so you can retry with more gas or after fixing the receiver.
After a successful replay the stored hash is deleted and StateSyncReplay(stateId) is emitted. Replaying the same state sync again reverts with !found.
Failures recorded before the Uburu upgrade are replayed with replayFailedStateSync(uint256 stateId), which takes only the state ID.
Keep the work done inside onStateReceive small, or watch StateCommitted for success = false and replay failures with enough gas. For FxPortal receivers, the same applies to processMessageFromRoot.
System calls
The state sync commit on Bor uses a system call. Only the system address 2^160-2 can make a system call. Bor calls it internally with the system address as msg.sender, which changes contract state and updates the state root for the block, without requiring a user-initiated transaction. This is inspired by EIP-210.
State-sync logs and Bor block receipts
Events emitted by system calls are handled differently from normal logs. Bor produces a synthetic transaction and receipt for each state-sync event, so clients can query these events through standard Ethereum JSON-RPC methods. The transaction hash is derived from:
keccak256("matic-bor-receipt-" + block number + block hash)
This synthetic transaction does not affect consensus logic. eth_getBlockByNumber, eth_getTransactionReceipt, and eth_getLogs include state-sync logs from the derived transaction. Note that the block bloom filter does not include state-sync log entries, and the derived transaction is not included in transactionRoot or receiptRoot.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Polygon Developer Docs","colors":{"primary":"#670DE5","light":"#9551F5","dark":"#500AB2"},"logo":{"light":"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/light.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=d54ddb30492807a0eadf38093c075f2f","dark":"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/dark.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=3b2b67f82ff1720328da11b176a86499"},"favicon":"https://mintcdn.com/polygon-labs/Xy_MJE0q00vmTroE/favicon.svg?fit=max\u0026auto=format\u0026n=Xy_MJE0q00vmTroE\u0026q=85\u0026s=3c26f9a9ab4a7a50ac3da5c9ad26c954","api":{"openapi":"api-reference/openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive"},"mdx":{"server":["https://sandbox-api.polygon.technology/v0.13","https://api.polygon.technology/v0.13"]}},"appearance":{"default":"light"},"navbar":{"links":[{"href":"/payments/build-with-ai","label":"Build with AI"},{"href":"https://polygon.technology/get-access?utm_source=docs\u0026utm_medium=navbar\u0026utm_campaign=oms_access","label":"Request OMS Access"}]},"footer":{"socials":{"x":"https://x.com/0xPolygon","github":"https://github.com/0xPolygon","linkedin":"https://www.linkedin.com/company/polygonlabs","discord":"https://discord.com/invite/polygon-support-635865020172861441"},"links":[{"items":[{"label":"Support","href":"https://support.polygon.technology/support/home"}]},{"items":[{"label":"Changelog","href":"/changelog"},{"label":"Security","href":"/tools/security/overview"}]}]},"fonts":{"family":"Fustat"},"integrations":{"ga4":{"measurementId":"G-RJ6JC0EEY5"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"polygon-labs","hasAudioNarration":false,"actualSubdomain":"polygon-labs","customDomains":["docs.polygon.technology"],"gitSource":{"type":"github","owner":"0xpolygon","repo":"new-polygon-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"contextualFeedback":{"allowEmail":true},"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0d95f9313c97d7e30968c6","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Developer Docs","count":482},{"language":"default","tag":"Polygon Chain","count":383},{"language":"default","tag":"Wallets","count":178},{"language":"default","tag":"API Reference","count":93},{"language":"default","tag":"Developer Tools","count":93},{"language":"default","tag":"Agglayer","count":73},{"language":"default","tag":"Non-custodial","count":61},{"language":"default","tag":"Matic.js","count":59},{"language":"default","tag":"SDK","count":55},{"language":"default","tag":"Guides","count":39}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@polygon.technology","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"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":"site-roles","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":"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":"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":"turbopuffer-dual-write","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":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"69cbd3d67f226f107dbd9b72","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"Can I move assets between different chains with OMS?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:01:58.134Z","updatedAt":"2026-03-31T14:01:58.134Z","__v":0},{"_id":"69cbd3b07f226f107dbd9a9b","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"What are my options for integrating a wallet?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:01:20.206Z","updatedAt":"2026-03-31T14:01:20.206Z","__v":0},{"_id":"69cbd3737f226f107dbd9910","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How does KYC / KYB work in OMS?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:00:19.974Z","updatedAt":"2026-03-31T14:00:19.974Z","__v":0}],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":".nav-tabs{gap:0!important;align-items:center!important}div:has(>.nav-tabs){height:58px!important}.nav-tabs a.nav-tabs-item{padding:7px 12px!important;font-size:14px;font-weight:500;color:#64708F!important;transition:color 120ms ease, background 120ms ease}.nav-tabs a.nav-tabs-item:hover{color:#141635!important}html.dark .nav-tabs a.nav-tabs-item{color:rgba(255, 255, 255, 0.55)!important}html.dark .nav-tabs a.nav-tabs-item:hover{color:#fff!important}.fam-grp{display:inline-flex;align-items:center;gap:4px}.fam-gap{width:1px;height:22px;background:#DFE3F0;margin:0 16px;flex-shrink:0}.fam-grp .nav-tabs-item>div{display:none!important}.fam-grp .nav-tabs-item{padding:7px 12px!important;border-radius:8px;font-size:14px;font-weight:500;color:#64708F!important;white-space:nowrap;text-decoration:none;transition:color 120ms ease, background 120ms ease!important}.fam-grp .nav-tabs-item:hover{color:#141635!important}.fam-grp .nav-tabs-item.fam-active-tab{background:#EAE4F5!important;color:#500AB2!important;font-weight:500!important}.fam-grp .nav-tabs-item.fam-active-tab svg{color:#500AB2!important}html.dark .fam-gap{background:rgba(255, 255, 255, 0.14)}html.dark .fam-grp .nav-tabs-item{color:rgba(255, 255, 255, 0.55)!important}html.dark .fam-grp .nav-tabs-item:hover{color:#fff!important}html.dark .fam-grp .nav-tabs-item.fam-active-tab{background:rgba(103, 13, 229, 0.22)!important;color:#A78BFA!important}html.dark .fam-grp .nav-tabs-item.fam-active-tab svg{color:#A78BFA!important}#navbar a[href*=\"build-with-ai\"]{background:#fff!important;color:#141635!important;border:1px solid #C8CFE1!important;font-weight:600!important;transition:border-color 140ms ease, background 140ms ease!important}#navbar a[href*=\"build-with-ai\"]:hover{border-color:#141635!important;background:#F6F6FC!important}html.dark #navbar a[href*=\"build-with-ai\"]{background:transparent!important;color:#fff!important;border-color:rgba(255, 255, 255, 0.25)!important}html.dark #navbar a[href*=\"build-with-ai\"]:hover{border-color:#fff!important;background:rgba(255, 255, 255, 0.06)!important}#navbar a[href*=\"get-access\"]{background:#0B0814!important;color:#fff!important;border:1px solid #0B0814!important;transition:background 140ms ease!important}#navbar a[href*=\"get-access\"]:hover{background:#2A2640!important}html.dark #navbar a[href*=\"get-access\"]{background:#FFFFFF!important;color:#0B0814!important;border-color:#FFFFFF!important}html.dark #navbar a[href*=\"get-access\"]:hover{background:#E5E7EB!important;border-color:#E5E7EB!important}#sidebar-content a.text-primary,#sidebar-content a[class*=\"text-primary-light\"]{background-color:transparent!important}#sidebar-content a:not(.text-primary):not([class*=\"text-primary-light\"]):hover{background-color:rgba(103, 13, 229, 0.06)!important}#content-area:has(.api-section) #page-title{font-size:1.75rem;line-height:2.25rem}#content-area:has(.api-section) #header .prose{font-size:0.9375rem;line-height:1.6}@container page-header (min-width: 520px){#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow{display:flex;align-items:center;min-height:2.25rem;padding-right:11rem}#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow~div:has(#page-context-menu){position:static}#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow~div #page-context-menu{position:absolute;top:0;right:0;margin:0}}.api-section[data-api-section=\"authorizations\"]:has(+.api-section[data-api-section=\"headers\"]) .api-section-heading-title{font-size:0}.api-section[data-api-section=\"authorizations\"]:has(+.api-section[data-api-section=\"headers\"]) .api-section-heading-title::after{content:\"Authorization and headers\";font-size:1.125rem}.api-section[data-api-section=\"authorizations\"]+.api-section[data-api-section=\"headers\"] .api-section-heading{display:none}.api-section[data-api-section=\"authorizations\"]:has(+.api-section[data-api-section=\"headers\"]) .primitive-param-field:last-child{border-bottom-width:1px}.api-section .api-section-heading .border-b,.api-section .primitive-param-field{border-color:#D1D5DB}html.dark .api-section .api-section-heading .border-b,html.dark .api-section .primitive-param-field{border-color:#374151}.api-section .primitive-param-field>.py-6{padding-top:0.875rem;padding-bottom:0.875rem}.api-section .primitive-param-field .mt-4{margin-top:0.5rem}@media (min-width: 1600px){#body-content:has(.api-section){max-width:1760px}#body-content:has(.api-section) #content-container{max-width:1440px}}.nav-tabs a.nav-tabs-item[href^=\"/tools/security\"],.nav-tabs a.nav-tabs-item[href=\"/changelog\"]{display:none!important}"},{"filePath":"oms-visuals.css","content":"@font-face{font-family:\"Fustat\";src:url(\"/fonts/Fustat-VariableFont_wght.woff2\") format(\"woff2\");font-weight:200 900;font-style:normal;font-display:swap}@font-face{font-family:\"Geist Mono\";src:url(\"/fonts/GeistMono-VariableFont_wght.woff2\") format(\"woff2\");font-weight:100 900;font-style:normal;font-display:swap}.oms-v{--oms-purple-50: #f6f3fb;--oms-purple-100: #eae4f5;--oms-purple-200: #d5c4f2;--oms-purple-300: #b78eef;--oms-purple-400: #9551f5;--oms-purple-500: #670de5;--oms-purple-600: #500ab2;--oms-purple-700: #400a8e;--oms-slate-50: #f6f6fc;--oms-slate-100: #eef0f9;--oms-slate-200: #dfe3f0;--oms-slate-300: #c8cfe1;--oms-slate-400: #929eba;--oms-slate-500: #64708f;--oms-slate-600: #48526f;--oms-slate-700: #363e5c;--oms-slate-800: #222744;--oms-slate-900: #141635;--oms-slate-950: #090624;--oms-btn-primary: #090624;--oms-btn-primary-hover: #222744;--oms-btn-primary-text: #ffffff;--ss-font: \"Fustat\", \"Inter\", system-ui, sans-serif;--ss-mono: \"Geist Mono\", \"JetBrains Mono\", ui-monospace, monospace;--ss-accent: #670de5;--ss-accent-2: #9551f5;--ss-accent-soft: #eae4f5;--ss-accent-text: #500ab2;--ss-canvas: #f6f6fc;--ss-well: #f6f6fc;--ss-surface: #ffffff;--ss-raised: #ffffff;--ss-chrome: #ffffff;--ss-fill: #eef0f9;--ss-line: #c8cfe1;--ss-line-faint: #dfe3f0;--ss-text-strong: #141635;--ss-text: #48526f;--ss-text-faint: #64708f;--ss-icon: #48526f;--ss-icon-faint: #929eba;--ss-ink-1: rgba(20, 22, 53, 0.04);--ss-ink-2: rgba(20, 22, 53, 0.06);--ss-ink-3: rgba(20, 22, 53, 0.08);--ss-ink-4: rgba(20, 22, 53, 0.10);--ss-ink-5: rgba(20, 22, 53, 0.15);--ss-success: #10b981;--ss-success-soft: #ecfdf5;--ss-success-text: #047857;--ss-warning: #b45309;--ss-warning-soft: #fff7ed;--ss-warning-text: #b45309;--ss-danger: #dc2626;--ss-danger-soft: #fef2f2;--ss-danger-text: #b91c1c;--ss-radius-sm: 6px;--ss-radius-md: 8px;--ss-radius-lg: 12px;--ss-radius-window: 12px;--ss-radius-pill: 999px;--ss-shadow-window: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.08);--ss-shadow-float: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--ss-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);--ss-shadow-hero: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 30px 60px -12px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);--ss-shadow-lift: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 12px 28px -6px rgba(50, 50, 93, 0.28), 0 6px 12px -6px rgba(0, 0, 0, 0.16);--ss-shadow-satellite: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 14px 32px -8px rgba(50, 50, 93, 0.24), 0 4px 10px -4px rgba(0, 0, 0, 0.1);--ss-shadow-ground: 0 0 0 1px rgba(50, 50, 93, 0.06), 0 24px 48px -24px rgba(50, 50, 93, 0.18);--ss-ease: cubic-bezier(0.16, 1, 0.3, 1);font-family:var(--ss-font);color:var(--ss-text);-webkit-font-smoothing:antialiased}html.dark .oms-v{--oms-btn-primary: #ffffff;--oms-btn-primary-hover: #e5e7eb;--oms-btn-primary-text: #090624;--ss-accent: #9551f5;--ss-accent-2: #b78eef;--ss-accent-soft: rgba(149, 81, 245, 0.16);--ss-accent-text: #b78eef;--ss-canvas: #0b0a10;--ss-well: #131218;--ss-surface: #1a1922;--ss-raised: #23212d;--ss-chrome: #16151d;--ss-fill: #2a2834;--ss-line: rgba(255, 255, 255, 0.10);--ss-line-faint: rgba(255, 255, 255, 0.06);--ss-text-strong: #eef0f9;--ss-text: #c8cfe1;--ss-text-faint: #929eba;--ss-icon: #c8cfe1;--ss-icon-faint: #64708f;--ss-ink-1: rgba(255, 255, 255, 0.05);--ss-ink-2: rgba(255, 255, 255, 0.07);--ss-ink-3: rgba(255, 255, 255, 0.10);--ss-ink-4: rgba(255, 255, 255, 0.13);--ss-ink-5: rgba(255, 255, 255, 0.20);--ss-success: #34d399;--ss-success-soft: rgba(16, 185, 129, 0.16);--ss-success-text: #34d399;--ss-shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.4);--ss-shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.3);--ss-shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.05);--ss-shadow-hero: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 60px -12px rgba(0, 0, 0, 0.6);--ss-shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 28px -6px rgba(0, 0, 0, 0.6);--ss-shadow-satellite: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 14px 32px -8px rgba(0, 0, 0, 0.7), 0 4px 10px -4px rgba(0, 0, 0, 0.5);--ss-shadow-ground: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 48px -24px rgba(0, 0, 0, 0.6)}.oms-v-fit{position:relative;width:100%}.oms-v-stage{position:absolute;top:0;left:0;transform-origin:0 0;overflow:hidden}.oms-v *,.oms-v *::before,.oms-v *::after{box-sizing:border-box}.oms-v :where(h1,h2,h3,h4,p,ul,ol){margin:0}.oms-v .oms-badge{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border-radius:16px;border:0.5px solid transparent;font-family:var(--ss-font);font-weight:500;font-size:12px;line-height:1;white-space:nowrap;text-box:trim-both cap alphabetic}.oms-v .oms-badge--info{background:#f6f3fb;border-color:#d5c4f2;color:#500ab2}.oms-v .oms-badge--neutral{background:#f6f6fc;border-color:#c8cfe1;color:#141635}.oms-v .oms-badge--success{background:#ecfdf5;border-color:#a7f3d0;color:#047857}.oms-v .oms-badge--warning{background:#fff7ed;border-color:#fed7aa;color:#b45309}.oms-v .oms-badge--danger{background:#fef2f2;border-color:#fecaca;color:#b91c1c}html.dark .oms-v .oms-badge--info{background:rgba(149, 81, 245, 0.14);border-color:rgba(183, 142, 239, 0.35);color:#c9b0f5}html.dark .oms-v .oms-badge--neutral{background:rgba(255, 255, 255, 0.05);border-color:rgba(255, 255, 255, 0.14);color:#c8cfe1}html.dark .oms-v .oms-badge--success{background:rgba(16, 185, 129, 0.14);border-color:rgba(52, 211, 153, 0.35);color:#6ee7b7}html.dark .oms-v .oms-badge--warning{background:rgba(251, 191, 36, 0.12);border-color:rgba(251, 191, 36, 0.3);color:#fcd34d}html.dark .oms-v .oms-badge--danger{background:rgba(248, 113, 113, 0.12);border-color:rgba(248, 113, 113, 0.3);color:#fca5a5}.oms-v .oms-phone{position:relative;flex-shrink:0;--oms-phone-glass: #0b0b0c;--oms-phone-rim: #2c2c2d;--oms-phone-band-1: #e3e3e6;--oms-phone-band-2: #9a9ba0;--oms-phone-band-3: #cfd0d4;--oms-phone-band-4: #85868b;--oms-phone-band-5: #c9cacd;box-shadow:0 calc(var(--ps) * 40) calc(var(--ps) * 80) calc(var(--ps) * -16) rgba(50, 50, 93, 0.25),\n 0 calc(var(--ps) * 24) calc(var(--ps) * 48) calc(var(--ps) * -24) rgba(0, 0, 0, 0.3)}html.dark .oms-v .oms-phone{--oms-phone-band-1: #5b5c61;--oms-phone-band-2: #2b2c2f;--oms-phone-band-3: #48494d;--oms-phone-band-4: #232427;--oms-phone-band-5: #404145}.oms-v .oms-phone__bands{position:absolute;inset:0;overflow:visible;pointer-events:none}.oms-v .oms-phone__glass{position:relative;height:100%}.oms-v .oms-phone__window{position:relative;overflow:hidden;isolation:isolate}.oms-v .oms-phone__screen{position:absolute;top:0;left:0;width:402px;height:874px;display:flex;flex-direction:column;overflow:hidden;background:#fff;color:#000;font-family:-apple-system, system-ui, sans-serif;font-size:15px;letter-spacing:-0.015em;transform-origin:0 0;-webkit-font-smoothing:antialiased}.oms-v .oms-phone[data-dark] .oms-phone__screen{background:#000;color:#fff}.oms-v .oms-phone__status{position:absolute;top:0;right:0;left:0;z-index:2;height:62px;transition:color 0.3s ease;will-change:transform}.oms-v .oms-phone__time{position:absolute;top:21.5px;left:0;width:138.5px;line-height:22px;text-align:center;font-family:\"SF Pro Text\", -apple-system, system-ui, sans-serif;font-variation-settings:\"opsz\" 17;font-size:17.67px;font-weight:590;letter-spacing:0}.oms-v .oms-phone__glyphs{position:absolute;top:25.33px;left:285.25px;display:flex;align-items:flex-start;gap:8px}.oms-v .oms-phone__glyphs svg{display:block}.oms-v .oms-phone__signal{margin-top:1px}.oms-v .oms-phone__battery{margin-top:0.33px}.oms-v .oms-phone__island{position:absolute;top:14px;left:50%;z-index:3;width:95px;height:37px;border-radius:18.5px;background:#000;transform:translateX(-50%)}.oms-v .oms-phone__content{position:relative;flex:1;min-height:0;padding-top:62px}.oms-v .oms-phone__home{position:absolute;bottom:8px;left:50%;z-index:2;width:144px;height:5px;border-radius:2.5px;background:currentColor;transform:translateX(-50%);transition:color 0.3s ease;will-change:transform}.obz{overflow:hidden;border-radius:14px;background:linear-gradient(110deg, rgba(255, 255, 255, 0.18) 0%, transparent 22%, transparent 32%, rgba(255, 255, 255, 0.1) 44%, transparent 60%),\n linear-gradient(135deg, var(--obz-from) 0%, var(--obz-to) 100%);--obz-ink: var(--ss-text-strong);--obz-faint: var(--oms-slate-500);--obz-app: var(--oms-slate-50);--obz-card: #fff;--obz-rule: var(--oms-slate-200)}.obz--payouts{--obz-from: #7c3aed;--obz-to: #3b0764}.obz--rewards{--obz-from: #10b981;--obz-to: #064e3b}html.dark .obz{--obz-faint: var(--oms-slate-400);--obz-app: #0b0a10;--obz-card: #1a1922;--obz-rule: rgba(255, 255, 255, 0.08)}.obz .obz-phone{position:absolute;top:30px;left:30px}.obz .obz-app{position:absolute;inset:0;padding-top:62px;background:var(--obz-app);color:var(--obz-ink);text-align:left;font-family:var(--ss-font)}.obz .obz-btn .obz-states,.obz .obz-status,.obz .obz-big--count{transition:opacity 0.38s ease}.obz .obz-app[data-fade] :is(.obz-btn .obz-states,.obz-status,.obz-big--count){opacity:0}.obz .obz-title{transition:opacity 0.2s ease}.obz .obz-app[data-notif] .obz-title{opacity:0}.obz .obz-head{display:flex;align-items:baseline;justify-content:space-between;padding:8px 36px 14px}.obz--payouts .obz-head{padding-bottom:10px}.obz--rewards .obz-head{padding-bottom:34px}.obz .obz-title{font-size:32px;font-weight:700;line-height:38px;letter-spacing:-0.02em;color:var(--obz-ink)}.obz .obz-head__meta{font-size:19px;line-height:25px;color:var(--obz-faint)}.obz .obz-card{display:block;margin:0 16px 12px;border-radius:22px;background:var(--obz-card);box-shadow:0 0 0 0.5px var(--obz-rule)}.obz .obz-batch,.obz .obz-balance{display:grid;justify-items:start;padding:18px 20px 20px}.obz--payouts .obz-batch{padding-bottom:16px}.obz .obz-label{font-size:19px;line-height:25px;color:var(--obz-faint)}.obz .obz-big{margin-top:2px;font-size:50px;font-weight:700;line-height:58px;letter-spacing:-0.03em;color:var(--obz-ink)}.obz .obz-big--count{margin:4px 0 2px;font-size:60px;line-height:68px}.obz .obz-count{display:inline-flex;align-items:baseline;white-space:nowrap;font-variant-numeric:tabular-nums}.obz .obz-count__char{display:inline-block;font-variant-numeric:normal}.obz .obz-count__digit{display:inline-block;height:1em;overflow:hidden;line-height:1;vertical-align:baseline;mask-image:linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent)}.obz .obz-count__strip{display:flex;flex-direction:column;will-change:transform;transition:transform 900ms cubic-bezier(0.3, 0.75, 0.1, 1)}.obz .obz-count__strip>span{display:block;height:1em;line-height:1}.obz .obz-count__unit{display:inline-block;margin-left:8px;font-size:22px;font-weight:600;letter-spacing:0;color:var(--obz-faint)}.obz .obz-btn{position:relative;isolation:isolate;display:grid;place-items:center;justify-self:stretch;height:58px;margin-top:14px;border-radius:16px;color:var(--oms-btn-primary-text);font-size:20px;font-weight:600}.obz .obz-btn::before{content:\"\";position:absolute;inset:0;z-index:-1;border-radius:inherit;background:var(--oms-btn-primary);transition:transform 0.15s ease, background-color 0.2s ease}.obz .obz-btn[data-pressed]::before{transform:scale(0.97);background:var(--oms-btn-primary-hover)}.obz .obz-btn__group{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:180px;height:26px}.obz .obz-btn__group--icon{justify-content:flex-start;padding-left:44px}.obz .obz-btn__group svg{flex:none}.obz .obz-spin{animation:obz-spin 0.8s linear infinite}@keyframes obz-spin{to{transform:rotate(360deg)}}.obz .obz-touch{position:absolute;left:50%;top:50%;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;background:rgba(255, 255, 255, 0.35);box-shadow:0 0 0 1.5px rgba(255, 255, 255, 0.55);opacity:0;transform:scale(0.6);transition:opacity 0.3s ease, transform 0.3s ease;pointer-events:none}.obz .obz-touch[data-on]{opacity:1;transform:scale(1);transition:opacity 0.08s ease, transform 0.12s ease}.obz .obz-states{display:inline-grid;align-items:center;justify-items:center}.obz .obz-states__item{display:inline-flex;grid-area:1 / 1;align-items:center;opacity:0;filter:blur(2px);will-change:transform;transform:translate3d(0, 4px, 0);transition:opacity 0.15s ease, filter 0.15s ease, transform 0s 0.15s}.obz .obz-states__item[data-on]{opacity:1;filter:none;transform:translate3d(0, 0, 0);transition:opacity 0.25s ease-out 0.07s, filter 0.25s ease-out 0.07s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.07s}.obz .obz-status{display:inline-grid;justify-items:end;margin-right:10px;flex:none}.obz--payouts .obz-status{margin-right:6px}.obz--rewards .obz-status{width:96px}.obz .obz-list{padding:4px 0}.obz .obz-row{display:flex;align-items:center;gap:14px;padding:14px;will-change:transform}.obz .obz-list>.obz-row+.obz-row,.obz .obz-list>.obz-collapse+.obz-row{box-shadow:0 -0.5px 0 var(--obz-rule)}.obz .obz-row__body{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.obz .obz-row__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:21px;font-weight:600;line-height:28px;color:var(--obz-ink)}.obz .obz-row__sub{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:19px;line-height:28px;color:var(--ss-text)}.obz--payouts .obz-row__sub{font-size:18px}.obz .obz-bar{display:block;border-radius:5px;background:var(--ss-ink-3)}.obz .obz-bar--title{height:11px;margin:8.5px 0;background:var(--ss-ink-4)}.obz .obz-bar--sub{height:9px;margin:9.5px 0}.obz .obz-avatar{display:inline-grid;flex:none;place-items:center;width:48px;height:48px;border-radius:50%;color:#fff;font-size:20px;font-weight:600;line-height:1;will-change:transform}.obz .obz-avatar>span{display:block;text-box:trim-both cap alphabetic}.obz .obz-avatar--plain{background:var(--ss-fill)}.obz .obz-tile{display:grid;flex:none;place-items:center;width:48px;height:48px;border-radius:14px;background:var(--ss-success-soft);color:var(--ss-success-text)}.obz .obz-tile--plain{background:var(--ss-ink-1)}html.dark .obz .obz-tile{background:rgba(16, 185, 129, 0.14);color:#34d399}html.dark .obz .obz-tile--plain{background:rgba(255, 255, 255, 0.06)}.obz .oms-badge.obz-badge{padding:5px 12px;border-radius:16px;font-size:19px;line-height:22px}.obz .obz-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows 0.42s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, opacity 0.42s cubic-bezier(0, 0.8, 0.5, 1)}.obz .obz-collapse[data-open]{grid-template-rows:1fr;opacity:1;transition:grid-template-rows 0.5s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.3s ease 0.24s}.obz .obz-collapse__inner{min-height:0;overflow:visible}.obz .obz-collapse__inner>*{transform:translateY(-10px);transition:transform 0.3s ease}.obz .obz-collapse[data-open]>.obz-collapse__inner>*{transform:none;transition:transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s}.obz .obz-banner{position:absolute;inset:0;z-index:2;pointer-events:none;will-change:transform;transform:translateY(-52px) scale(0.96);opacity:0;transition:transform 0.45s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.3s ease 0.1s}.obz .obz-banner[data-show]{transform:none;opacity:1;transition:transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.2s ease}.obz .obz-notif{position:absolute;top:56px;left:18px;right:18px;display:flex;align-items:center;gap:13px;padding:14px 17px 14px 14px;border-radius:23px;background:rgba(255, 255, 255, 0.92);box-shadow:0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);color:#000;text-align:left;will-change:transform}.obz .obz-banner[data-dark] .obz-notif{background:rgba(252, 252, 253, 0.76);backdrop-filter:blur(30px) saturate(1.25);box-shadow:0 4px 24px rgba(0, 0, 0, 0.06)}.obz .obz-notif__icon{display:grid;flex:none;place-items:center;width:38px;height:38px;border-radius:9px;overflow:hidden;background:linear-gradient(160deg, #10b981, #047857);color:#fff}.obz .obz-notif__text{display:flex;flex:1;flex-direction:column;min-width:0;font-size:15px;line-height:18px;letter-spacing:-0.016em}.obz .obz-notif__head{display:flex;align-items:baseline;gap:8px}.obz .obz-notif__title{flex:1;min-width:0;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis}.obz .obz-notif__time{flex:none;font-size:12px;letter-spacing:-0.005em;color:rgba(60, 60, 67, 0.6)}.obz .obz-notif__body{display:-webkit-box;overflow:hidden;-webkit-line-clamp:3;-webkit-box-orient:vertical}@media (prefers-reduced-motion: reduce){.obz .obz-spin{animation:none}}"},{"filePath":"agentic-visuals.css","content":"@keyframes acx-packet{from{stroke-dashoffset:14;opacity:1}88%{opacity:1}to{stroke-dashoffset:-100;opacity:0}}.oms-v .acx{--acx-brand: #0f766e;--acx-brand-soft: #e6f4f2;--acx-brand-ink: #ffffff;font-size:13px;line-height:18px;color:var(--ss-text)}html.dark .oms-v .acx{--acx-brand: #2dd4bf;--acx-brand-soft: rgba(45, 212, 191, 0.12);--acx-brand-ink: #062c29}.oms-v .acx-scene{position:absolute;inset:0;transition:opacity 0.45s var(--ss-ease)}.oms-v .acx-scene[data-hide]{opacity:0}.oms-v .acx-wires{position:absolute;inset:0;overflow:visible}.oms-v .acx-wire{fill:none;stroke:var(--ss-line);stroke-width:1.25;stroke-dasharray:3 4;transition:stroke 0.6s var(--ss-ease)}.oms-v .acx-wire[data-lit]{stroke:var(--ss-accent-2);stroke-dasharray:none;stroke-width:1.5}.oms-v .acx-packet{fill:none;stroke:var(--ss-accent);stroke-width:3;stroke-linecap:round;stroke-dasharray:14 200;stroke-dashoffset:14;opacity:0;animation:acx-packet 700ms cubic-bezier(0.45, 0, 0.25, 1) forwards}.oms-v .acx-app{position:absolute;display:flex;flex-direction:column;overflow:hidden;font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Inter\", system-ui, sans-serif;border-radius:var(--ss-radius-lg);background:var(--ss-surface);box-shadow:var(--ss-shadow-lift)}.oms-v .acx-scene[data-layout=\"wide\"] .acx-app{border-bottom-left-radius:0;border-bottom-right-radius:0}.oms-v .acx-app__bar{flex:none;display:flex;align-items:center;justify-content:space-between;height:52px;padding:0 16px;border-bottom:1px solid var(--ss-line-faint)}.oms-v .acx-wordmark{font-size:16px;font-weight:700;letter-spacing:-0.01em;color:var(--acx-brand)}.oms-v .acx-app__me{width:26px;height:26px;border-radius:50%;background:var(--ss-fill)}.oms-v .acx-history{flex:none;display:flex;flex-direction:column;gap:10px;padding:20px 16px 0}.oms-v .acx-hist{display:flex;flex-direction:column;gap:7px;padding:12px 13px;max-width:78%}.oms-v .acx-hist span{display:block;height:6px;border-radius:3px;background:var(--ss-line)}.oms-v .acx-hist--them{align-self:flex-start;border-radius:4px 16px 16px 16px;background:var(--ss-well)}.oms-v .acx-hist--me{align-self:flex-end;border-radius:16px 16px 4px 16px;background:var(--acx-brand-soft)}.oms-v .acx-hist--me span{background:var(--acx-brand);opacity:0.3}.oms-v .acx-scene[data-layout=\"compact\"] .acx-history{display:none}.oms-v .acx-scene[data-layout=\"compact\"] .acx-thread{padding-top:20px}.oms-v .acx-thread{flex:1;display:flex;flex-direction:column;gap:14px;padding:14px 16px 20px;opacity:0;transition:opacity 0.4s var(--ss-ease)}.oms-v .acx-thread[data-on]{opacity:1}.oms-v .acx-bubble--me{align-self:flex-end;max-width:78%;padding:9px 13px;border-radius:16px 16px 4px 16px;background:var(--acx-brand);color:var(--acx-brand-ink);font-size:13px;line-height:18px;opacity:0;transform:translateY(6px);transition:opacity 0.4s var(--ss-ease), transform 0.4s var(--ss-ease)}.oms-v .acx-bubble--me[data-on]{opacity:1;transform:none}.oms-v .acx-reply{display:flex;flex-direction:column;gap:6px;max-width:86%;opacity:0;transform:translateY(6px);transition:opacity 0.4s var(--ss-ease), transform 0.4s var(--ss-ease)}.oms-v .acx-reply[data-on]{opacity:1;transform:none}.oms-v .acx-reply__who{font-size:11px;line-height:14px;color:var(--ss-text-faint)}.oms-v .acx-receipt{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border-radius:4px 16px 16px 16px;background:var(--ss-well);box-shadow:0 0 0 1px var(--ss-line-faint)}.oms-v .acx-receipt__row{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.oms-v .acx-receipt__host{color:var(--ss-text-strong);font-weight:600}.oms-v .acx-receipt__amount{color:var(--ss-text-strong);font-weight:600}.oms-v .acx-receipt__status{position:relative;height:18px;font-size:12px}.oms-v .acx-state{position:absolute;inset:0;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;color:var(--ss-text-faint);opacity:0;transition:opacity 0.2s var(--ss-ease)}.oms-v .acx-state[data-on]{opacity:1;transition:opacity 0.3s var(--ss-ease) 0.2s}.oms-v .acx-state--paid{color:var(--ss-success-text)}.oms-v .acx-budget{flex:none;display:flex;flex-direction:column;gap:8px;margin:0 16px 16px;padding:14px;border-radius:var(--ss-radius-md);background:var(--acx-brand-soft)}.oms-v .acx-scene[data-layout=\"wide\"] .acx-budget{margin-bottom:16px}.oms-v .acx-budget__row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;color:var(--ss-text)}.oms-v .acx-budget__value{font-variant-numeric:tabular-nums;white-space:nowrap}.oms-v .acx-budget__value strong{color:var(--ss-text-strong);font-weight:600;font-size:13px}.oms-v .acx-budget__bar{height:5px;border-radius:5px;background:var(--ss-surface);overflow:hidden}.oms-v .acx-budget__bar span{display:block;width:100%;height:100%;background:var(--acx-brand);transform-origin:left center;transition:transform 0.5s var(--ss-ease)}.oms-v .acx-caption{position:absolute;font-size:11px;line-height:14px;color:var(--ss-text-faint);letter-spacing:0.02em}.oms-v .acx-node{position:absolute;display:flex;align-items:center;gap:10px;padding:0 12px;border-radius:var(--ss-radius-md);background:var(--ss-surface);box-shadow:var(--ss-shadow-card), 0 0 0 1px var(--ss-line-faint);transition:opacity 0.4s var(--ss-ease), box-shadow 0.4s var(--ss-ease)}.oms-v .acx-node[data-on] .acx-tile:not(.acx-tile--vault){background:var(--ss-accent-soft);color:var(--ss-accent-text)}.oms-v .acx-node[data-on] .acx-node__text span{color:var(--ss-text)}.oms-v .acx-node[data-idle]{opacity:0.5}.oms-v .acx-node__text{display:flex;flex-direction:column;gap:2px;min-width:0}.oms-v .acx-node__text strong{color:var(--ss-text-strong);font-weight:600;font-size:13px;line-height:17px;white-space:nowrap}.oms-v .acx-node__text span{color:var(--ss-text-faint);font-size:12px;line-height:16px;white-space:nowrap}.oms-v .acx-hidden{display:inline-flex;align-items:center;gap:4px}.oms-v .acx-tile{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--ss-fill);color:var(--ss-icon);transition:background 0.4s var(--ss-ease), color 0.4s var(--ss-ease)}.oms-v .acx-tile--vault{background:var(--oms-btn-primary);color:var(--oms-btn-primary-text)}@media (prefers-reduced-motion: reduce){.oms-v .acx-packet{animation:none}}.oms-v-fit:has(.acx){margin-inline:auto;margin-block:8px 24px}"}]}
{"page":{"pagePath":"pos/architecture/bor/state-sync","slug":"/pos/architecture/bor/state-sync","pageMetadata":{"title":"State sync","description":"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.","href":"/pos/architecture/bor/state-sync"},"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 state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\"\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`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`State sync is the mechanism by which contract state on Ethereum is propagated to the Bor chain. It allows dApps on Polygon Chain to read and react to events that originate on Ethereum.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-state-sync-works`,children:`How state sync works`}),`\n`,_jsx(_components.p,{children:`State transfer from Ethereum to Bor happens through a system call:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`A contract on Ethereum calls `,_jsx(_components.code,{children:`syncState`}),` on the `,_jsx(_components.code,{children:`StateSender.sol`}),` contract, emitting a `,_jsx(_components.code,{children:`StateSynced`}),` event.`]}),`\n`,_jsxs(_components.li,{children:[`Heimdall validators listen for `,_jsx(_components.code,{children:`StateSynced`}),` events. One validator sends a state-sync transaction to Heimdall.`]}),`\n`,_jsx(_components.li,{children:`Once the transaction is included in a Heimdall block, it is added to the pending state-sync list.`}),`\n`,_jsx(_components.li,{children:`After every sprint on Bor (currently 16 blocks), the Bor node fetches pending state-sync records from Heimdall via API.`}),`\n`,_jsxs(_components.li,{children:[`Bor commits these records at the start of each sprint by calling `,_jsx(_components.code,{children:`onStateReceive`}),` on the target contract. This is a system call from address `,_jsx(_components.code,{children:`2^160-2`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The receiver contract on Bor must implement `,_jsx(_components.code,{children:`IStateReceiver`}),`. The `,_jsx(_components.code,{children:`onStateReceive`}),` function can only be called by `,_jsx(_components.code,{children:`StateReceiver.sol`}),` at address `,_jsx(_components.code,{children:`0x0000000000000000000000000000000000001001`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`state-sender-contract`,children:`State sender contract`}),`\n`,_jsxs(_components.p,{children:[`Source: `,_jsx(_components.a,{href:`https://github.com/0xPolygon/pos-contracts/blob/develop/contracts/root/stateSyncer/StateSender.sol`,children:`StateSender.sol`})]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`StateSender`}),` contract on Ethereum exposes a `,_jsx(_components.code,{children:`syncState`}),` function:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`jsx`,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:`jsx`,children:_jsxs(_components.code,{language:`jsx`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`contract`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` StateSender`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" * Emits `stateSynced` events to start sync process on Ethereum chain\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` receiver`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Target contract on Bor chain`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Data to send`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` syncState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` receiver`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` bytes`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` calldata`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`})]}),`\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:`external`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Calling `,_jsx(_components.code,{children:`syncState`}),` emits the following event:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`jsx`,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:`jsx`,children:_jsxs(_components.code,{language:`jsx`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" * Emits `stateSynced` events to start sync process on Ethereum chain\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` id`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` State id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` contractAddress`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Target contract address on Bor`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Data to send to Bor chain for Target contract address`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StateSynced`}),_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\":`#9CDCFE`},children:` uint256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` indexed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` id`}),_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\":`#9CDCFE`},children:` address`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` indexed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` contractAddress`}),_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\":`#9CDCFE`},children:` bytes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Once the `,_jsx(_components.code,{children:`StateSynced`}),` event is emitted, Heimdall listens for it. After 2/3+ validators agree, the state-sync record is added to Heimdall state. Bor fetches and applies it at the start of the next sprint.`]}),`\n`,_jsx(Heading,{level:`2`,id:`state-receiver-interface-on-bor`,children:`State receiver interface on Bor`}),`\n`,_jsx(_components.p,{children:`The target contract on Bor must implement the following interface:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`jsx`,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:`jsx`,children:_jsxs(_components.code,{language:`jsx`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// IStateReceiver represents interface to receive state`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`interface`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` IStateReceiver`}),_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\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onStateReceive`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` stateId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`bytes`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` calldata`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`external`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.code,{children:`StateReceiver.sol`}),` at address `,_jsx(_components.code,{children:`0x0000000000000000000000000000000000001001`}),` is permitted to call `,_jsx(_components.code,{children:`onStateReceive`}),` on target contracts.`]}),`\n`,_jsx(Heading,{level:`2`,id:`gas-for-receivers`,children:`Gas for receivers`}),`\n`,_jsxs(_components.p,{children:[`Since the Uburu upgrade, `,_jsx(_components.code,{children:`StateReceiver`}),` gives each `,_jsx(_components.code,{children:`onStateReceive`}),` call a bounded amount of gas. It reads the amount from the `,_jsx(_components.code,{children:`StateSyncGasOracle`}),` contract at `,_jsx(_components.code,{children:`0x5e3a5eafd4501332c0bc2acfd38df3ebc5152147`}),`, capped at 5,000,000. If the oracle cannot be read, it uses 160,000. At the time of writing, `,_jsx(_components.code,{children:`gasLimit()`}),` on the oracle returns 160,000 on mainnet. Governance can change this value, so read it from the oracle instead of hard-coding it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cast`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` call`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0x5e3a5eafd4501332c0bc2acfd38df3ebc5152147`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gasLimit()(uint256)\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rpc-url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://polygon-bor-rpc.publicnode.com`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`failed-state-syncs-and-replay`,children:`Failed state syncs and replay`}),`\n`,_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`onStateReceive`}),` runs out of gas or reverts, the state sync is not lost. `,_jsx(_components.code,{children:`StateReceiver`}),` emits `,_jsx(_components.code,{children:`StateCommitted(stateId, false)`}),`, stores a hash of the receiver address and the state data, and continues with the next record. Anyone can replay the failed state sync later.`]}),`\n`,_jsx(Heading,{level:`3`,id:`check-whether-a-delivery-failed`,children:`Check whether a delivery failed`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`StateCommitted(uint256 indexed stateId, bool success)`}),` is emitted for every state sync delivered to a contract. A `,_jsx(_components.code,{children:`success`}),` value of `,_jsx(_components.code,{children:`false`}),` marks a failure. To check a specific state sync, read the stored hash:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cast`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` call`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0x0000000000000000000000000000000000001001`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"failedStateSyncHashes(uint256)(bytes32)\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`stateI`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rpc-url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`bor-rpc-ur`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`l`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`A non-zero result means the state sync failed and has not been replayed. It is zero if the delivery succeeded, if the state sync was already replayed, or if the receiver was not a contract.`}),`\n`,_jsx(Heading,{level:`3`,id:`replay-a-failed-state-sync`,children:`Replay a failed state sync`}),`\n`,_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`replayFailedStateSyncWithData`}),` on `,_jsx(_components.code,{children:`StateReceiver`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`solidity`,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:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` replayFailedStateSyncWithData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` uint256`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` stateId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` address`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` receiver`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bytes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` calldata`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` stateData`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`external`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The arguments are the `,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`contractAddress`}),` and `,_jsx(_components.code,{children:`data`}),` of the `,_jsx(_components.code,{children:`StateSynced`}),` event that the `,_jsx(_components.code,{children:`StateSender`}),` contract emitted on Ethereum. You can also read them from the state-sync record on Heimdall; see the `,_jsx(_components.a,{href:`/pos/architecture/heimdall_v2/clerk/`,children:`clerk module`}),`. The contract checks that `,_jsx(_components.code,{children:`keccak256(abi.encode(receiver, stateData))`}),` matches the stored hash.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cast`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` send`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0x0000000000000000000000000000000000001001`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"replayFailedStateSyncWithData(uint256,address,bytes)\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`stateI`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`receive`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`stateDat`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --gas-limit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gas-limi`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`t`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rpc-url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`bor-rpc-ur`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`l`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --private-key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`private-ke`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`y`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Keep the following in mind:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Anyone can call it. The caller pays the gas.`}),`\n`,_jsxs(_components.li,{children:[`The replay is not limited by the oracle. The receiver gets the gas your transaction provides, so set a `,_jsx(_components.code,{children:`--gas-limit`}),` that is enough for `,_jsx(_components.code,{children:`onStateReceive`}),`.`]}),`\n`,_jsx(_components.li,{children:`If the receiver reverts again, the whole replay transaction reverts and the stored hash is kept, so you can retry with more gas or after fixing the receiver.`}),`\n`,_jsxs(_components.li,{children:[`After a successful replay the stored hash is deleted and `,_jsx(_components.code,{children:`StateSyncReplay(stateId)`}),` is emitted. Replaying the same state sync again reverts with `,_jsx(_components.code,{children:`!found`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Failures recorded before the Uburu upgrade are replayed with `,_jsx(_components.code,{children:`replayFailedStateSync(uint256 stateId)`}),`, which takes only the state ID.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Keep the work done inside `,_jsx(_components.code,{children:`onStateReceive`}),` small, or watch `,_jsx(_components.code,{children:`StateCommitted`}),` for `,_jsx(_components.code,{children:`success = false`}),` and replay failures with enough gas. For FxPortal receivers, the same applies to `,_jsx(_components.code,{children:`processMessageFromRoot`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`system-calls`,children:`System calls`}),`\n`,_jsxs(_components.p,{children:[`The state sync commit on Bor uses a system call. Only the system address `,_jsx(_components.code,{children:`2^160-2`}),` can make a system call. Bor calls it internally with the system address as `,_jsx(_components.code,{children:`msg.sender`}),`, which changes contract state and updates the state root for the block, without requiring a user-initiated transaction. This is inspired by `,_jsx(_components.a,{href:`https://github.com/ethereum/EIPs/blob/master/EIPS/eip-210.md`,children:`EIP-210`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`state-sync-logs-and-bor-block-receipts`,children:`State-sync logs and Bor block receipts`}),`\n`,_jsx(_components.p,{children:`Events emitted by system calls are handled differently from normal logs. Bor produces a synthetic transaction and receipt for each state-sync event, so clients can query these events through standard Ethereum JSON-RPC methods. The transaction hash is derived from:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`jsx`,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:`jsx`,children:_jsxs(_components.code,{language:`jsx`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`keccak256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"matic-bor-receipt-\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` number`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` hash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This synthetic transaction does not affect consensus logic. `,_jsx(_components.code,{children:`eth_getBlockByNumber`}),`, `,_jsx(_components.code,{children:`eth_getTransactionReceipt`}),`, and `,_jsx(_components.code,{children:`eth_getLogs`}),` include state-sync logs from the derived transaction. Note that the block bloom filter does not include state-sync log entries, and the derived transaction is not included in `,_jsx(_components.code,{children:`transactionRoot`}),` or `,_jsx(_components.code,{children:`receiptRoot`}),`.`]})]})}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":"State sync","description":"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.","href":"/pos/architecture/bor/state-sync"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How state sync works","slug":"how-state-sync-works","depth":2,"children":[]},{"title":"State sender contract","slug":"state-sender-contract","depth":2,"children":[]},{"title":"State receiver interface on Bor","slug":"state-receiver-interface-on-bor","depth":2,"children":[]},{"title":"Gas for receivers","slug":"gas-for-receivers","depth":2,"children":[]},{"title":"Failed state syncs and replay","slug":"failed-state-syncs-and-replay","depth":2,"children":[{"title":"Check whether a delivery failed","slug":"check-whether-a-delivery-failed","depth":3,"children":[]},{"title":"Replay a failed state sync","slug":"replay-a-failed-state-sync","depth":3,"children":[]}]},{"title":"System calls","slug":"system-calls","depth":2,"children":[]},{"title":"State-sync logs and Bor block receipts","slug":"state-sync-logs-and-bor-block-receipts","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/polygon-labs/3aef159c73509324/analytics.js","/_mintlify/custom/polygon-labs/ce02b95119847965/custom.js"],"subdomain":"polygon-labs","siteName":"Polygon Developer Docs","title":"State sync - Polygon Developer Docs","contextualStarterQuestions":[{"_id":"6af5ea196eb2b54075446a04","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How does state sync work?","status":"active","generatedBy":"contextual","path":"pos/architecture/bor/state-sync","createdAt":"2026-11-12T16:32:25.794Z","updatedAt":"2026-11-12T16:32:25.794Z","__v":0},{"_id":"6af5ea196eb2b54075446a06","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How do I implement IStateReceiver?","status":"active","generatedBy":"contextual","path":"pos/architecture/bor/state-sync","createdAt":"2026-11-12T16:32:25.794Z","updatedAt":"2026-11-12T16:32:25.794Z","__v":0},{"_id":"6af5ea196eb2b54075446a05","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"What is the StateReceiver contract?","status":"active","generatedBy":"contextual","path":"pos/architecture/bor/state-sync","createdAt":"2026-11-12T16:32:25.794Z","updatedAt":"2026-11-12T16:32:25.794Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T16:32:20.632Z","originalFileLocation":"pos/architecture/bor/state-sync.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=\"light\"}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 state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_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/polygon-labs/mGaxVdHZf09e3t79/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"State sync - Polygon Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.polygon.technology/pos/architecture/bor/state-sync\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://polygon-labs.mintlify.site/_mintlify/api/og/v2?division=Bor\u0026amp;title=State+sync\u0026amp;description=How+state+sync+works+in+Polygon+Chain%2C+allowing+Ethereum+contract+state+to+be+reflected+in+Bor+through+the+StateSender+and+StateReceiver+contracts.\u0026amp;theme=b36bd2d42ef34b1589e85268\u0026amp;signature=f23a4244a665b9ac7bb8b28899fb3cd39ac2ef3699a0e892ef48c0c2c539e39d\">\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=\"State sync - Polygon Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://polygon-labs.mintlify.site/_mintlify/api/og/v2?division=Bor\u0026amp;title=State+sync\u0026amp;description=How+state+sync+works+in+Polygon+Chain%2C+allowing+Ethereum+contract+state+to+be+reflected+in+Bor+through+the+StateSender+and+StateReceiver+contracts.\u0026amp;theme=b36bd2d42ef34b1589e85268\u0026amp;signature=f23a4244a665b9ac7bb8b28899fb3cd39ac2ef3699a0e892ef48c0c2c539e39d\">\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/polygon-labs/mGaxVdHZf09e3t79/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#670DE5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.polygon.technology/pos/architecture/bor/state-sync\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/pos/architecture/bor/state-sync.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.polygon.technology/#organization\",\"name\":\"Polygon Developer Docs\",\"url\":\"https://docs.polygon.technology\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/light.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=d54ddb30492807a0eadf38093c075f2f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.polygon.technology#website\",\"name\":\"Polygon Developer Docs\",\"url\":\"https://docs.polygon.technology\",\"publisher\":{\"@id\":\"https://docs.polygon.technology/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync#webpage\",\"url\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync\",\"name\":\"State sync\",\"description\":\"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\",\"dateModified\":\"2026-11-12T16:32:20.632Z\",\"isPartOf\":{\"@id\":\"https://docs.polygon.technology#website\"},\"breadcrumb\":{\"@id\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Polygon Chain\",\"item\":\"https://docs.polygon.technology/pos/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Architecture\",\"item\":\"https://docs.polygon.technology/pos/architecture/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bor\",\"item\":\"https://docs.polygon.technology/pos/architecture/bor/introduction\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"State sync\",\"item\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync#article\",\"headline\":\"State sync\",\"name\":\"State sync\",\"description\":\"How state sync works in Polygon Chain, allowing Ethereum contract state to be reflected in Bor through the StateSender and StateReceiver contracts.\",\"url\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync\",\"mainEntityOfPage\":{\"@id\":\"https://docs.polygon.technology/pos/architecture/bor/state-sync#webpage\"},\"dateModified\":\"2026-11-12T16:32:20.632Z\",\"publisher\":{\"@id\":\"https://docs.polygon.technology/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.polygon.technology#website\"}}]}\u003c/script>","agentPointerHref":"/pos/architecture/bor/state-sync.md","siteName":"Polygon Developer Docs","nav":{"global":null,"products":[{"product":"Developer Docs","icon":"code","description":"APIs, SDKs, and infrastructure guides for builders","tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":""}]},{"tab":"Payments","pages":[{"title":"Payments","href":"/payments/overview"}]},{"tab":"Wallets","pages":[{"title":"Wallets","href":"/wallets/overview"}]},{"tab":"Cross-chain","pages":[{"title":"Cross-chain","href":"/cross-chain"}]},{"tab":"Agentic","pages":[{"title":"Agentic","href":"/payment-services/agentic-payments/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Polygon Chain","groups":[{"group":"Polygon Chain","expanded":true,"pages":[{"title":"Polygon Chain overview","sidebarTitle":"Overview","href":"/pos/overview"},{"title":"Building on PoS","sidebarTitle":"Get Started","href":"/pos/get-started/building-on-polygon"},{"group":"Guides","expanded":true,"pages":[{"group":"Stablecoin Integrations","pages":[{"title":"Available stablecoins","href":"/payment-services/stablecoins/available-stablecoins"},{"title":"USDC Native Integration","href":"/payment-services/stablecoins/usdc-native-integration"},{"title":"USDC Gateway Integration","href":"/payment-services/stablecoins/usdc-gateway-integration"}]},{"group":"Run a Node","pages":[{"title":"Prerequisites","href":"/pos/how-to/prerequisites"},{"title":"Sync node using snapshots","href":"/pos/how-to/snapshots"},{"group":"Full Node","pages":[{"title":"Using binaries","href":"/pos/how-to/full-node/full-node-binaries"},{"title":"Using Docker","href":"/pos/how-to/full-node/full-node-docker"},{"title":"Using Ansible","href":"/pos/how-to/full-node/full-node-ansible"},{"title":"Using packages","href":"/pos/how-to/full-node/full-node-packages"},{"title":"Using GCP","href":"/pos/how-to/full-node/full-node-gcp"}]},{"group":"Troubleshoot","pages":[{"title":"Technical FAQs","href":"/pos/how-to/troubleshoot/technical-faqs"},{"title":"Known issues and errors","href":"/pos/how-to/troubleshoot/known-issues"},{"title":"Reporting issues","href":"/pos/how-to/troubleshoot/reporting-issues"}]},{"group":"Bridging","pages":[{"group":"Ethereum Polygon","pages":[{"title":"Polygon Portal","href":"/pos/how-to/bridging/ethereum-polygon/portal-ui"},{"title":"Ethereum to PoS","href":"/pos/how-to/bridging/ethereum-polygon/ethereum-to-matic"},{"title":"PoS to Ethereum","href":"/pos/how-to/bridging/ethereum-polygon/matic-to-ethereum"},{"title":"Submit mapping request","href":"/pos/how-to/bridging/ethereum-polygon/submit-mapping-request"}]},{"group":"L1-L2 Communication","pages":[{"title":"State Transfer","href":"/pos/how-to/bridging/l1-l2-communication/state-transfer"}]}]}]},{"group":"Run a Validator","pages":[{"title":"Becoming a validator","href":"/pos/get-started/becoming-a-validator"},{"group":"Validator","pages":[{"title":"Using binaries","href":"/pos/how-to/validator/validator-binaries"},{"title":"Using Ansible","href":"/pos/how-to/validator/validator-ansible"},{"title":"Using packages","href":"/pos/how-to/validator/validator-packages"}]},{"group":"Operate Validator Node","pages":[{"title":"Validator best practices","href":"/pos/how-to/validator/validator-best-practices"},{"title":"Next steps","href":"/pos/how-to/operate-validator-node/next-steps"},{"title":"Change owner and signer address","href":"/pos/how-to/operate-validator-node/change-signer-address"},{"title":"Top up Heimdall fee","href":"/pos/how-to/operate-validator-node/topup-heimdall-fee"},{"title":"Validator performance requirements","href":"/pos/how-to/operate-validator-node/validator-performance"}]},{"title":"Delegate tokens","href":"/pos/how-to/delegate"}]}]},{"group":"Architecture","expanded":true,"pages":[{"title":"Overview","href":"/pos/architecture/overview"},{"group":"Bor","pages":[{"title":"Introduction","description":"How Bor, Polygon Chain's block production layer, works: producer selection, spans, sprints, stall detection, and state synchronization with Ethereum.","href":"/pos/architecture/bor/introduction"},{"title":"State sync","href":"/pos/architecture/bor/state-sync"},{"title":"Network configuration","description":"Default ports used by Bor and Heimdall nodes for peer connections, RPC, WebSocket, monitoring, and discovery.","href":"/pos/architecture/bor/network-config"}]},{"group":"Heimdall v2","pages":[{"title":"Introduction","href":"/pos/architecture/heimdall_v2/introduction"},{"title":"Changes from v1","href":"/pos/architecture/heimdall_v2/changes-from-v1"},{"title":"Authentication","href":"/pos/architecture/heimdall_v2/authentication"},{"title":"Balance transfers","href":"/pos/architecture/heimdall_v2/balance-transfers"},{"title":"Staking","href":"/pos/architecture/heimdall_v2/staking"},{"title":"Checkpoints","href":"/pos/architecture/heimdall_v2/checkpoints"},{"title":"Topup","href":"/pos/architecture/heimdall_v2/topup"},{"title":"Chain management","href":"/pos/architecture/heimdall_v2/chain-management"},{"title":"Governance","href":"/pos/architecture/heimdall_v2/governance"},{"title":"Clerk","href":"/pos/architecture/heimdall_v2/clerk"},{"title":"Heimdall Bor module","href":"/pos/architecture/heimdall_v2/heimdall-bor-module"},{"title":"Milestones","href":"/pos/architecture/heimdall_v2/milestones"}]}]},{"group":"Paychannels","expanded":true,"pages":[{"title":"Paychannels: high-frequency payments on Polygon Chain","sidebarTitle":"Overview","href":"/pos/paychannels/overview"},{"title":"Try a Paychannels demo","sidebarTitle":"Try a demo","href":"/pos/paychannels/try-a-demo"},{"title":"Accept Paychannels payments","sidebarTitle":"Accept payments","href":"/pos/paychannels/accept-payments"},{"title":"Run a Paychannels hub","sidebarTitle":"Run a hub","href":"/pos/paychannels/run-a-hub"},{"title":"Paychannels trust model","sidebarTitle":"Trust model","href":"/pos/paychannels/trust-model"},{"title":"Privacy with Paychannels","sidebarTitle":"Privacy","href":"/pos/paychannels/privacy"}]},{"group":"Governance","expanded":true,"pages":[{"title":"Governance fundamentals","href":"/pos/governance/governance-fundamentals"}]},{"group":"Concepts","expanded":true,"pages":[{"group":"Finality","pages":[{"title":"Finality","href":"/pos/concepts/finality/finality"}]},{"group":"Tokens","pages":[{"title":"Migrate to POL","href":"/pos/concepts/tokens/matic-to-pol"},{"title":"POL","href":"/pos/concepts/tokens/pol"},{"title":"sPOL","href":"/pos/concepts/tokens/spol"},{"title":"MATIC","href":"/pos/concepts/tokens/matic"}]},{"group":"Transactions","pages":[{"title":"EIP-1559","href":"/pos/concepts/transactions/eip-1559"},{"title":"EIP-4337","href":"/pos/concepts/transactions/eip-4337"},{"title":"Meta transactions","href":"/pos/concepts/transactions/meta-transactions"}]}]},{"group":"Reference","expanded":true,"pages":[{"group":"Contracts","pages":[{"title":"Genesis contracts","href":"/pos/reference/contracts/genesis-contracts"},{"title":"Delegation via validator shares","href":"/pos/reference/contracts/delegation"},{"title":"Staking manager","href":"/pos/reference/contracts/stakingmanager"}]},{"title":"Rewards and staking incentives","href":"/pos/reference/rewards"},{"title":"Setting Up Telemetry","href":"/pos/reference/telemetry-setup-guide"},{"title":"Default ports for nodes","href":"/pos/reference/port-management"},{"title":"Network upgrade process","href":"/pos/reference/network-upgrade-process"},{"title":"Common commands","href":"/pos/reference/commands"},{"title":"Seed and bootnodes","href":"/pos/reference/seed-and-bootnodes"},{"title":"PoS mainnet multi-signatures","href":"/pos/reference/commit-chain-multisigs"},{"title":"RPC endpoints","href":"/pos/reference/rpc-endpoints"},{"title":"Mapped tokens","href":"/pos/reference/mapped-tokens"}]},{"group":"Developer Tools","pages":[{"title":"Developer Tools for Polygon","sidebarTitle":"Overview","href":"/tools/index"},{"title":"On-ramps and off-ramps","href":"/tools/onramps-offramps"},{"title":"Payment providers","href":"/tools/payment-providers"},{"group":"Gas","pages":[{"title":"Test token faucets","href":"/tools/gas/matic-faucet"},{"title":"Estimate gas fees","href":"/tools/gas/polygon-gas-station"}]},{"group":"Wallets","pages":[{"title":"Polygon Portal","href":"/tools/wallets/portal"},{"group":"MetaMask operations","pages":[{"title":"MetaMask on Polygon","sidebarTitle":"Overview","href":"/tools/wallets/metamask/overview"},{"title":"Add Polygon network","href":"/tools/wallets/metamask/add-polygon-network"}]},{"title":"Getting Started with Polygon Wallets","sidebarTitle":"Getting started","href":"/tools/wallets/getting-started"},{"title":"WalletConnect","href":"/tools/wallets/walletconnect"},{"title":"Reown","href":"/tools/wallets/reown"},{"title":"AppKit","href":"/tools/wallets/appkit"},{"title":"WalletKit","href":"/tools/wallets/walletkit"}]},{"group":"Dapp Development","pages":[{"group":"Tutorials","pages":[{"title":"Interact with a node RPC","href":"/tools/dApp-development/tutorials/access-node"}]},{"group":"Common Tools","pages":[{"title":"Hardhat","href":"/tools/dApp-development/common-tools/hardhat"},{"title":"Remix","href":"/tools/dApp-development/common-tools/remix"},{"title":"Replit","href":"/tools/dApp-development/common-tools/replit"}]},{"group":"Launchpad","pages":[{"title":"dApp Launchpad Introduction","sidebarTitle":"Introduction","href":"/tools/dApp-development/launchpad/intro"},{"title":"Quickstart","href":"/tools/dApp-development/launchpad/quickstart"},{"title":"Frontend","href":"/tools/dApp-development/launchpad/frontend"},{"title":"Smart contracts","href":"/tools/dApp-development/launchpad/smart-contracts"},{"title":"Commands","href":"/tools/dApp-development/launchpad/commands"},{"title":"Contributing","href":"/tools/dApp-development/launchpad/contributing"},{"title":"Common pitfalls","href":"/tools/dApp-development/launchpad/common-pitfalls"}]},{"title":"Tutorials","href":"/tools/dApp-development/third-party-tutorials"}]},{"group":"Chain Indexer Framework","pages":[{"title":"Chain Indexer Framework Overview","sidebarTitle":"Overview","href":"/tools/chain-indexer-framework/overview"},{"title":"Usage","href":"/tools/chain-indexer-framework/usage"}]},{"group":"Matic.js","pages":[{"title":"Get started","href":"/tools/matic-js/get-started"},{"group":"Polygon Chain","pages":[{"title":"POS client","href":"/tools/matic-js/pos/client"},{"group":"Erc20","pages":[{"title":"ERC20 with Matic.js on Polygon PoS","sidebarTitle":"Overview","href":"/tools/matic-js/pos/erc20/index"},{"title":"approveMax","href":"/tools/matic-js/pos/erc20/approve-max"},{"title":"approve","href":"/tools/matic-js/pos/erc20/approve"},{"title":"deposit","href":"/tools/matic-js/pos/erc20/deposit"},{"title":"getAllowance","href":"/tools/matic-js/pos/erc20/get-allowance"},{"title":"getBalance","href":"/tools/matic-js/pos/erc20/get-balance"},{"title":"isWithdrawExited","href":"/tools/matic-js/pos/erc20/is-withdraw-exited"},{"title":"transfer","href":"/tools/matic-js/pos/erc20/transfer"},{"title":"withdrawExitFaster","href":"/tools/matic-js/pos/erc20/withdraw-exit-faster"},{"title":"withdrawExit","href":"/tools/matic-js/pos/erc20/withdraw-exit"},{"title":"withdrawStart","href":"/tools/matic-js/pos/erc20/withdraw-start"}]},{"group":"Erc721","pages":[{"title":"ERC721 with Matic.js on Polygon PoS","sidebarTitle":"Overview","href":"/tools/matic-js/pos/erc721/index"},{"title":"approveAll","href":"/tools/matic-js/pos/erc721/approve-all"},{"title":"approve","href":"/tools/matic-js/pos/erc721/approve"},{"title":"depositMany","href":"/tools/matic-js/pos/erc721/deposit-many"},{"title":"deposit","href":"/tools/matic-js/pos/erc721/deposit"},{"title":"getAllTokens","href":"/tools/matic-js/pos/erc721/get-all-tokens"},{"title":"getTokenIdAtIndexForUser","href":"/tools/matic-js/pos/erc721/get-token-id-at-index-for-user"},{"title":"getTokensCount","href":"/tools/matic-js/pos/erc721/get-tokens-count"},{"title":"isApprovedAll","href":"/tools/matic-js/pos/erc721/is-approved-all"},{"title":"isApproved","href":"/tools/matic-js/pos/erc721/is-approved"},{"title":"isWithdrawExitedMany","href":"/tools/matic-js/pos/erc721/is-withdraw-exited-many"},{"title":"isWithdrawExited","href":"/tools/matic-js/pos/erc721/is-withdraw-exited"},{"title":"transfer","href":"/tools/matic-js/pos/erc721/transfer"},{"title":"withdrawExitFasterMany","href":"/tools/matic-js/pos/erc721/withdraw-exit-faster-many"},{"title":"withdrawExitFaster","href":"/tools/matic-js/pos/erc721/withdraw-exit-faster"},{"title":"withdrawExitMany","href":"/tools/matic-js/pos/erc721/withdraw-exit-many"},{"title":"withdrawExit","href":"/tools/matic-js/pos/erc721/withdraw-exit"},{"title":"withdrawStartMany","href":"/tools/matic-js/pos/erc721/withdraw-start-many"},{"title":"withdrawStartWithMetaData","href":"/tools/matic-js/pos/erc721/withdraw-start-with-meta-data"},{"title":"withdrawStart","href":"/tools/matic-js/pos/erc721/withdraw-start"}]},{"group":"Erc1155","pages":[{"title":"approveAllForMintable","href":"/tools/matic-js/pos/erc1155/approve-all-for-mintable"},{"title":"approveAll","href":"/tools/matic-js/pos/erc1155/approve-all"},{"title":"depositMany","href":"/tools/matic-js/pos/erc1155/deposit-many"},{"title":"deposit","href":"/tools/matic-js/pos/erc1155/deposit"},{"title":"getBalance","href":"/tools/matic-js/pos/erc1155/get-balance"},{"title":"ERC1155 with Matic.js on Polygon PoS","sidebarTitle":"Overview","href":"/tools/matic-js/pos/erc1155/index"},{"title":"isApprovedAll","href":"/tools/matic-js/pos/erc1155/is-approved-all"},{"title":"isWithdrawExitedMany","href":"/tools/matic-js/pos/erc1155/is-withdraw-exited-many"},{"title":"isWithdrawExited","href":"/tools/matic-js/pos/erc1155/is-withdraw-exited"},{"title":"transfer","href":"/tools/matic-js/pos/erc1155/transfer"},{"title":"withdrawExitFasterMany","href":"/tools/matic-js/pos/erc1155/withdraw-exit-faster-many"},{"title":"withdrawExitFaster","href":"/tools/matic-js/pos/erc1155/withdraw-exit-faster"},{"title":"withdrawExitMany","href":"/tools/matic-js/pos/erc1155/withdraw-exit-many"},{"title":"withdrawExit","href":"/tools/matic-js/pos/erc1155/withdraw-exit"},{"title":"withdrawStartMany","href":"/tools/matic-js/pos/erc1155/withdraw-start-many"},{"title":"withdrawStart","href":"/tools/matic-js/pos/erc1155/withdraw-start"}]},{"title":"Deposit ETH","href":"/tools/matic-js/pos/deposit-ether"},{"title":"isCheckPointed","href":"/tools/matic-js/pos/is-check-pointed"},{"title":"isDeposited","href":"/tools/matic-js/pos/is-deposited"}]},{"title":"Matic.js API Architecture","sidebarTitle":"API overview","href":"/tools/matic-js/api-architecture"},{"group":"Setup","pages":[{"title":"Ethers","href":"/tools/matic-js/setup/ethers"},{"title":"Web3js","href":"/tools/matic-js/setup/web3js"}]},{"title":"Set proof API","href":"/tools/matic-js/set-proof-api"},{"group":"Advanced","pages":[{"title":"ABI manager","href":"/tools/matic-js/advanced/abi-manager"},{"title":"Exit util","href":"/tools/matic-js/advanced/exit-util"},{"title":"Plugin","href":"/tools/matic-js/advanced/plugin"}]}]},{"group":"Data","pages":[{"title":"The Graph","href":"/tools/data/thegraph"}]},{"group":"Storage","pages":[{"title":"IPFS","href":"/tools/storage/ipfs"},{"title":"Filecoin","href":"/tools/storage/filecoinhelpers"},{"title":"Crust network","href":"/tools/storage/crusthelpers"}]},{"group":"Oracles","pages":[{"title":"Getting Started with Polygon Oracles","sidebarTitle":"Getting started","href":"/tools/oracles/getting-started"},{"title":"Chainlink","href":"/tools/oracles/chainlink"},{"title":"Supra","href":"/tools/oracles/supra"}]}]}]}]},{"tab":"Polygon CDK","pages":[{"title":"Polygon CDK","href":"/chain-development/cdk"}]},{"tab":"Agglayer","pages":[{"title":"Agglayer","href":"/interoperability/overview"}]},{"tab":"Security","hidden":true,"searchable":true,"pages":[{"title":"Security","href":"/tools/security/overview"}]},{"tab":"Changelog","hidden":true,"searchable":true,"pages":[{"title":"Changelog","href":"/changelog"}]}]},{"product":"Help Center","icon":"life-ring","description":"Dashboard how-tos for admins and business teams","pages":[{"title":"Help Center","href":"/help-center"}]}]},"basePath":"","title":"State sync - Polygon Developer Docs","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}