You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: clarify Permit2 approval requirement after bot create
- Add `needsPermit2Approval` flag to create response; always true since on-chain allowances are not verified at creation time
- Update create endpoint messaging to explicitly name Permit2, mention gas costs, and guide users to approve before dry-run or live start
- Add warning banner in OneShotRunner to highlight Permit2 + gas requirement when `highlightPermit2` is set
- Land on Tools tab after successful bot creation to make "Approve allowances" the next obvious step
- Display persistent Permit2 approval warning banner on BotDetail page that dismisses after approval succeeds
- Update confirmation dialogs and help text throughout to reference "Permit2" instead of vague "router allowance" language
- Clarify that approval transactions cost "a little gas" and are one-time operations per input token
- Add callback `onApproved` to OneShotRunner to dismiss Permit2 banner when approve action succeeds
@@ -50,7 +56,7 @@ export default function OneShotRunner({
50
56
if(
51
57
action==='approve'&&
52
58
!window.confirm(
53
-
`Approve the router allowances for ${bot}? This sends transactions from its operator wallet and costs gas.`,
59
+
`Approve Permit2 for ${bot}'s input tokens?\n\nThis sends transactions from its operator wallet and costs a little gas. Without this approval the bot cannot trade.`,
54
60
)
55
61
){
56
62
return
@@ -70,8 +76,12 @@ export default function OneShotRunner({
70
76
if(event==='line'){
71
77
setLines((prev)=>appendLine(prev,dataasLogLine))
72
78
}elseif(event==='exit'){
73
-
setExit(dataasExitEvent)
79
+
constresult=dataasExitEvent
80
+
setExit(result)
74
81
setRunning(null)
82
+
if(result.ok&&result.action==='approve'){
83
+
onApproved?.()
84
+
}
75
85
}elseif(event==='error'){
76
86
setError((dataas{message: string}).message)
77
87
setRunning(null)
@@ -88,6 +98,15 @@ export default function OneShotRunner({
88
98
89
99
return(
90
100
<divclassName="space-y-3">
101
+
{highlightPermit2&&(
102
+
<Bannertone="warning">
103
+
Before the first live start, run <strong>Approve allowances</strong>. That
104
+
grants Permit2 permission on each input token. The operator wallet needs a
105
+
little native gas for those one-time approval transactions — without them,
Copy file name to clipboardExpand all lines: web/src/components/SettingsForm.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -269,7 +269,7 @@ function CorridorCard({
269
269
asyncfunctionapply(){
270
270
if(
271
271
!window.confirm(
272
-
`Switch ${bot.name} to a different corridor?\n\nThis replaces stitch.toml with the preset (your signer is kept). A running bot is stopped — approve tokens for the new corridor before starting.`,
272
+
`Switch ${bot.name} to a different corridor?\n\nThis replaces stitch.toml with the preset (your signer is kept). A running bot is stopped — approve Permit2 for the new corridor's tokens (needs a little gas) before starting.`,
0 commit comments