Skip to content

Commit aec3b16

Browse files
committed
Merge branch 'feature/result-callback' of https://github.com/iExecBlockchainComputing/documentation into feature/result-callback
2 parents f26d075 + 5325468 commit aec3b16

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/guides/build-iapp/advanced/result-callback.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Result callback guide
33
description:
4-
Use the iExec result callback feature to have the protocol invoke a function on your
5-
smart contract at the end of a task execution.
4+
Use the iExec result callback feature to have the protocol invoke a function
5+
on your smart contract at the end of a task execution.
66
---
77

88
# Result Callback
@@ -20,23 +20,25 @@ Use a callback when your smart contract should:
2020

2121
## 🧩 High-level flow
2222

23-
1. A requester executes an iApp.
24-
2. The iApp writes `${IEXEC_OUT}/computed.json` with a `callback-data` field
23+
1. A requester deploys the smart contract that should receive the callback data.
24+
2. The requester executes an iApp and specifies the callback address.
25+
3. The iApp writes `${IEXEC_OUT}/computed.json` with a `callback-data` field
2526
(ABI‑encoded bytes you crafted).
26-
3. After the task completes and is validated, the iExec protocol invokes your
27+
4. After the task completes and is validated, the iExec protocol invokes your
2728
contract’s `receiveResult(bytes32,bytes)`.
28-
4. Your contract decodes and processes those bytes if callback data have been
29+
5. Your contract decodes and processes those bytes if callback data have been
2930
provided.
3031

3132
## Step-by-Step Implementation
3233

3334
### Step 1: Implement the Callback Contract
3435

35-
Your contract must expose `receiveResult(bytes32,bytes)`
36+
Your contract must expose the function `receiveResult(bytes32,bytes)`
3637
[ERC1154](https://github.com/iExecBlockchainComputing/iexec-solidity/blob/master/contracts/ERC1154/IERC1154.sol).
3738
The protocol calls it with:
3839

39-
- `_callID`: the first arg the taskId
40+
- `_callID`: This parameter represents the `taskId`, passed as the first
41+
argument
4042
- `callback`: exactly the bytes you encoded as `callback-data`
4143

4244
Decode using the same tuple. (Optional) Add protections: authorized caller check

0 commit comments

Comments
 (0)