{"eip":7833,"title":"Scheduled function calls","description":"Giving life to smart contracts by enabling their functions to be automatically invoked by block producers.","authors":["Keyvan Kambakhsh (@keyvank)","Nobitex Labs \u003clabs@nobitex.ir\u003e"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2024-12-06","discussionsTo":"https://ethereum-magicians.org/t/eip-7833-scheduled-function-calls/21975","repo":"EIPs","label":"EIP-7833","officialUrl":"https://eips.ethereum.org/EIPS/eip-7833","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7833.md","url":"https://eips.huatuo.xyz/eip-7833/","tldr":{"en":"Proposes an OFFERCALL opcode so a contract can schedule its own function for the next block by burning an ETH offer, with block producers required to run the top offers before user transactions.","ja":"OFFERCALL オペコードの提案。コントラクトが ETH のオファーをバーンすることで自身の関数を次のブロックに予約でき、ブロックプロデューサーはユーザートランザクションより先に上位のオファーを実行しなければならない。","ko":"OFFERCALL 옵코드 제안. 컨트랙트가 ETH 제안 금액을 소각해 자기 함수를 다음 블록에 예약할 수 있으며, 블록 생성자는 사용자 트랜잭션보다 먼저 상위 제안들을 실행해야 한다.","zh":"提议新增 OFFERCALL 操作码，合约可以通过销毁一笔 ETH 报价，为自己的函数预约下一个区块的执行，而区块生产者必须在用户交易之前运行出价最高的那些调用。"},"tags":["evm","opcode","automation","mev","core"],"explainers":{"en":{"lang":"en","tldr":"Proposes an OFFERCALL opcode so a contract can schedule its own function for the next block by burning an ETH offer, with block producers required to run the top offers before user transactions.","tags":["evm","opcode","automation","mev","core"],"related":[1559,7547],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7833/","markdown":"## What problem does it solve?\n\nSmart contracts never run by themselves. Something outside the chain must send a transaction: a keeper bot, an oracle updater, a liquidation bot. That brings problems:\n\n- **Timing.** Network delays or congestion can make the trigger arrive late, and for things like liquidations or rebalancing, late can mean losses.\n- **MEV.** Block producers decide ordering, so they can delay, front-run or sandwich the very transaction that would correct a market.\n- **Infrastructure.** Every protocol needs off-chain bots, which add cost and centralization.\n\nEIP-7833 proposes letting contracts schedule calls inside the protocol, so a function can act like an on-chain bot.\n\n## How it works\n\n- A new opcode, **`OFFERCALL`**, lets a contract offer an amount of ETH in exchange for having a given function called in the **next block**.\n- Nodes collect all offers, sort them by amount, and keep only the **top N**. The others are discarded.\n- Executing the kept scheduled calls becomes a **block validity rule**: they run before any user transactions, in ranked order.\n- The offered ETH is **burned**, not paid to the producer, so a producer cannot schedule calls that just pay itself back.\n- `OFFERCALL` fails if the contract does not hold enough ETH or the offer is not high enough to make the top N.\n\nA function that calls `OFFERCALL` on itself each time it runs keeps running every block. If one offer fails, the loop stops and the bot is \"dead\" until someone calls it manually again, presumably with a higher offer.\n\n## Sample code\n\nThe spec's own example, written in hypothetical Solidity syntax (no compiler supports `offercall`):\n\n```solidity\ncontract Bot {\n    uint256 offerPerCall;\n\n    constructor(uint256 _offer) {\n        offerPerCall = _offer;\n        offercall(update, offerPerCall);      // ignite: schedule first run for next block\n    }\n\n    function setOffer(uint256 _offer) external {\n        offerPerCall = _offer;\n    }\n\n    function update() external {\n        // ... do the scheduled work (rebalance, liquidate, update price) ...\n\n        // reschedule itself for the following block; if this fails, the bot stops\n        offercall(update, offerPerCall);\n    }\n}\n```\n\n## Things to know\n\n- Status is **Stagnant**. The proposal is brief: the opcode number, gas cost, the value of N, how arguments are passed, what `msg.sender` a scheduled call sees, and what happens if a scheduled call reverts are all unspecified, and there is no reference implementation.\n- Mandatory execution at the start of every block is a significant consensus change. It also eats into block space before any user transaction, and running scheduled calls continuously costs ETH every block.\n- The authors flag centralization risk: wealthy contracts could dominate the top-N slots.\n- The example has no access control on `setOffer`; a real contract would restrict it.\n- Today the same need is met off-chain by keeper networks and searchers. Forced-inclusion ideas such as inclusion lists ([EIP-7547](/eip-7547/)) attack the censorship side of the problem differently.\n"},"ja":{"lang":"ja","tldr":"OFFERCALL オペコードの提案。コントラクトが ETH のオファーをバーンすることで自身の関数を次のブロックに予約でき、ブロックプロデューサーはユーザートランザクションより先に上位のオファーを実行しなければならない。","tags":["evm","opcode","automation","mev","core"],"related":[1559,7547],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7833/","markdown":"## 何を解決するのか\n\nスマートコントラクトは自動では動きません。チェーンの外の何かがトランザクションを送る必要があります。キーパーボット、オラクルの更新、清算ボットなどです。これには次の問題があります。\n\n- **タイミング。** ネットワークの遅延や混雑でトリガーが遅れることがあり、清算やリバランスのようなものでは、遅れが損失につながりえます。\n- **MEV。** ブロックプロデューサーが順序を決めるため、市場を是正するはずのトランザクション自体を遅らせたり、フロントランしたり、サンドイッチしたりできます。\n- **インフラ。** あらゆるプロトコルがオフチェーンのボットを必要とし、コストと中央集権化が増します。\n\nEIP-7833 は、コントラクトがプロトコルの内部で呼び出しを予約できるようにし、関数がオンチェーンのボットのように動作できる仕組みを提案します。\n\n## 仕組み\n\n- 新しいオペコード **`OFFERCALL`** により、コントラクトは、指定した関数を**次のブロック**で呼び出してもらう対価として、ある額の ETH をオファーできます。\n- ノードはすべてのオファーを集め、額で並べ替え、**上位 N 件**だけを残します。残りは破棄されます。\n- 残された予約呼び出しの実行は**ブロックの有効性ルール**になります。これらはユーザートランザクションより前に、順位順に実行されます。\n- オファーされた ETH はプロデューサーに支払われるのではなく**バーン**されるため、プロデューサーが自分に払い戻すだけの呼び出しを予約することはできません。\n- コントラクトが十分な ETH を保持していない場合や、オファーが上位 N 件に入るほど高くない場合、`OFFERCALL` は失敗します。\n\n実行のたびに自分自身に対して `OFFERCALL` を呼び出す関数は、毎ブロック実行され続けます。1 つのオファーが失敗するとループは止まり、ボットは、おそらくより高いオファーで誰かが手動で再び呼び出すまで「死んだ」状態になります。\n\n## サンプルコード\n\n仕様自体の例を、架空の Solidity 構文で書いたものです（`offercall` をサポートするコンパイラはありません）。\n\n```solidity\ncontract Bot {\n    uint256 offerPerCall;\n\n    constructor(uint256 _offer) {\n        offerPerCall = _offer;\n        offercall(update, offerPerCall);      // ignite: schedule first run for next block\n    }\n\n    function setOffer(uint256 _offer) external {\n        offerPerCall = _offer;\n    }\n\n    function update() external {\n        // ... do the scheduled work (rebalance, liquidate, update price) ...\n\n        // reschedule itself for the following block; if this fails, the bot stops\n        offercall(update, offerPerCall);\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。提案は簡素で、オペコード番号、gas コスト、N の値、引数の渡し方、予約された呼び出しが見る `msg.sender`、予約された呼び出しが revert した場合の挙動はすべて未規定で、リファレンス実装もありません。\n- すべてのブロックの冒頭で実行を強制するのは、大きなコンセンサスの変更です。また、ユーザートランザクションより前にブロック空間を消費し、予約呼び出しを継続的に実行すると毎ブロック ETH がかかります。\n- 著者らは中央集権化のリスクを指摘しています。資金力のあるコントラクトが上位 N 件の枠を支配しうるというものです。\n- この例では `setOffer` にアクセス制御がありません。実際のコントラクトでは制限が必要です。\n- 現在、同じニーズはキーパーネットワークやサーチャーによってオフチェーンで満たされています。インクルージョンリスト（[EIP-7547](/eip-7547/)）のような強制インクルージョンのアイデアは、問題の検閲の側面に別の方法で取り組んでいます。\n"},"ko":{"lang":"ko","tldr":"OFFERCALL 옵코드 제안. 컨트랙트가 ETH 제안 금액을 소각해 자기 함수를 다음 블록에 예약할 수 있으며, 블록 생성자는 사용자 트랜잭션보다 먼저 상위 제안들을 실행해야 한다.","tags":["evm","opcode","automation","mev","core"],"related":[1559,7547],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7833/","markdown":"## 어떤 문제를 해결하나요?\n\n스마트 컨트랙트는 저절로 실행되지 않습니다. 체인 밖의 무언가가 트랜잭션을 보내야 합니다. 키퍼 봇, 오라클 업데이터, 청산 봇 같은 것들입니다. 여기에는 다음과 같은 문제가 따릅니다.\n\n- **타이밍.** 네트워크 지연이나 혼잡으로 트리거가 늦게 도착할 수 있고, 청산이나 리밸런싱 같은 경우 늦으면 손실이 될 수 있습니다.\n- **MEV.** 블록 생성자가 순서를 정하므로, 시장을 바로잡아야 할 바로 그 트랜잭션을 지연시키거나 프런트런하거나 샌드위치할 수 있습니다.\n- **인프라.** 모든 프로토콜이 오프체인 봇을 필요로 하며, 이는 비용과 중앙화를 늘립니다.\n\nEIP-7833은 컨트랙트가 프로토콜 안에서 호출을 예약할 수 있게 해, 함수가 온체인 봇처럼 동작할 수 있게 하자고 제안합니다.\n\n## 어떻게 동작하나요?\n\n- 새 옵코드 **`OFFERCALL`**을 사용하면 컨트랙트가 지정한 함수를 **다음 블록**에서 호출해 주는 대가로 일정 금액의 ETH를 제안할 수 있습니다.\n- 노드는 모든 제안을 모아 금액순으로 정렬하고 **상위 N개**만 남깁니다. 나머지는 버려집니다.\n- 남은 예약 호출을 실행하는 것은 **블록 유효성 규칙**이 됩니다. 이 호출들은 어떤 사용자 트랜잭션보다 먼저, 순위 순서대로 실행됩니다.\n- 제안된 ETH는 생성자에게 지급되지 않고 **소각**되므로, 생성자가 자기에게 돌려주기만 하는 호출을 예약할 수는 없습니다.\n- 컨트랙트가 충분한 ETH를 보유하지 않았거나 제안이 상위 N개에 들 만큼 높지 않으면 `OFFERCALL`은 실패합니다.\n\n실행될 때마다 자기 자신에게 `OFFERCALL`을 호출하는 함수는 매 블록 계속 실행됩니다. 제안 하나가 실패하면 루프가 멈추고, 누군가 다시 수동으로 호출할 때까지(아마 더 높은 제안으로) 봇은 \"죽은\" 상태가 됩니다.\n\n## 샘플 코드\n\n스펙 자체의 예제를 가상의 Solidity 문법으로 쓴 것입니다(`offercall`을 지원하는 컴파일러는 없습니다).\n\n```solidity\ncontract Bot {\n    uint256 offerPerCall;\n\n    constructor(uint256 _offer) {\n        offerPerCall = _offer;\n        offercall(update, offerPerCall);      // ignite: schedule first run for next block\n    }\n\n    function setOffer(uint256 _offer) external {\n        offerPerCall = _offer;\n    }\n\n    function update() external {\n        // ... do the scheduled work (rebalance, liquidate, update price) ...\n\n        // reschedule itself for the following block; if this fails, the bot stops\n        offercall(update, offerPerCall);\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 제안은 간략하며, 옵코드 번호, gas 비용, N의 값, 인자 전달 방식, 예약된 호출이 보는 `msg.sender`, 예약된 호출이 revert되면 어떻게 되는지가 모두 규정되어 있지 않고 참조 구현도 없습니다.\n- 모든 블록의 시작에서 실행을 강제하는 것은 중대한 합의 변경입니다. 또한 어떤 사용자 트랜잭션보다 먼저 블록 공간을 차지하며, 예약 호출을 계속 실행하려면 매 블록 ETH가 듭니다.\n- 저자들은 중앙화 위험을 지적합니다. 자금이 풍부한 컨트랙트가 상위 N개 자리를 독점할 수 있다는 것입니다.\n- 이 예제의 `setOffer`에는 접근 제어가 없습니다. 실제 컨트랙트라면 제한해야 합니다.\n- 오늘날 같은 수요는 키퍼 네트워크와 서처가 오프체인에서 충족합니다. 인클루전 리스트([EIP-7547](/eip-7547/)) 같은 강제 포함 아이디어는 문제의 검열 측면을 다른 방식으로 다룹니다.\n"},"zh":{"lang":"zh","tldr":"提议新增 OFFERCALL 操作码，合约可以通过销毁一笔 ETH 报价，为自己的函数预约下一个区块的执行，而区块生产者必须在用户交易之前运行出价最高的那些调用。","tags":["evm","opcode","automation","mev","core"],"related":[1559,7547],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7833/","markdown":"## 它解决什么问题？\n\n智能合约从不会自己运行。链外必须有东西发送交易：keeper 机器人、预言机更新器、清算机器人。这带来了一些问题：\n\n- **时机。** 网络延迟或拥堵可能使触发迟到，而对于清算或再平衡之类的事情，迟到可能意味着损失。\n- **MEV。** 区块生产者决定排序，因此可以延迟、抢跑或夹击那笔本该纠正市场的交易。\n- **基础设施。** 每个协议都需要链下机器人，这增加了成本和中心化。\n\nEIP-7833 提议让合约在协议内部预约调用，使一个函数可以像链上机器人一样工作。\n\n## 它如何运作\n\n- 新操作码 **`OFFERCALL`** 让合约出一笔 ETH 报价，换取在**下一个区块**中调用某个指定函数。\n- 节点收集所有报价，按金额排序，只保留**前 N 个**，其余丢弃。\n- 执行被保留的预约调用成为一条**区块有效性规则**：它们在任何用户交易之前，按排名顺序运行。\n- 报价的 ETH 会被**销毁**，而不是支付给生产者，因此生产者无法预约那些只是把钱付回给自己的调用。\n- 如果合约持有的 ETH 不足，或报价不够高、进不了前 N，`OFFERCALL` 就会失败。\n\n一个每次运行时都对自己调用 `OFFERCALL` 的函数，会在每个区块持续运行。如果某次报价失败，循环就会停止，机器人就\"死\"了，直到有人再次手动调用它，大概还要出更高的报价。\n\n## 示例代码\n\n规范自带的示例，用假想的 Solidity 语法书写（没有编译器支持 `offercall`）：\n\n```solidity\ncontract Bot {\n    uint256 offerPerCall;\n\n    constructor(uint256 _offer) {\n        offerPerCall = _offer;\n        offercall(update, offerPerCall);      // ignite: schedule first run for next block\n    }\n\n    function setOffer(uint256 _offer) external {\n        offerPerCall = _offer;\n    }\n\n    function update() external {\n        // ... do the scheduled work (rebalance, liquidate, update price) ...\n\n        // reschedule itself for the following block; if this fails, the bot stops\n        offercall(update, offerPerCall);\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。提案很简短：操作码编号、gas 成本、N 的取值、参数如何传递、预约调用看到的 `msg.sender` 是什么，以及预约调用 revert 时会怎样，全都没有规定，也没有参考实现。\n- 在每个区块开头强制执行是一项重大的共识变更。它还会在任何用户交易之前占用区块空间，而且持续运行预约调用每个区块都要花费 ETH。\n- 作者指出了中心化风险：资金雄厚的合约可能会垄断前 N 个名额。\n- 示例中的 `setOffer` 没有访问控制；真实的合约会对它加以限制。\n- 如今同样的需求由 keeper 网络和 searcher 在链下满足。诸如包含列表（[EIP-7547](/eip-7547/)）之类的强制包含思路，则以不同的方式处理这个问题的审查一面。\n"}}}
