Skip to content

Commit cd2e0a1

Browse files
committed
refactor: add gas limit information and ensure callback logic adheres to it
1 parent 83f9929 commit cd2e0a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ contract IExecCallbackReceiver {
8989
}
9090
```
9191

92+
::: tip Important
93+
94+
The callback transaction is subject to a gas limit of {{ gasLimit }}.
95+
Ensure your callback logic fits within this limit to avoid out-of-gas errors.
96+
97+
:::
98+
9299
### Step 3: Run the iApp with a Callback
93100

94101
When creating the request order, set the `callback` field to your callback
@@ -154,3 +161,22 @@ const taskId = await iexec.order.matchOrders({
154161
| Automation | Workflow step completion signal |
155162
| Dynamic parameters | Adjust rates / thresholds / quorums |
156163
| Logical bridge | Sync external (IoT / legacy) state |
164+
165+
<script setup>
166+
import { computed } from 'vue';
167+
import useUserStore from '@/stores/useUser.store';
168+
import { getChainById } from '@/utils/chain.utils';
169+
170+
// Get current chain info
171+
const userStore = useUserStore();
172+
const selectedChain = computed(() => userStore.getCurrentChainId());
173+
const chainData = computed(() => getChainById(selectedChain.value));
174+
const chainName = computed(() => chainData.value.chainName);
175+
176+
const gasLimit = computed(() => {
177+
const chainId = selectedChain.value;
178+
if (chainId === 42161) return '100,000'; // Arbitrum One
179+
if (chainId === 134) return '200,000'; // Bellecour
180+
return '100,000'; // default
181+
});
182+
</script>

0 commit comments

Comments
 (0)