From b5496bd128225e73b8497deed5403f76f54ffa00 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 May 2026 13:52:12 +0400 Subject: [PATCH] fix IFlowV5 rainlang example to include three sentinels The example showed only one sentinel as a stack item. A valid flow stack requires three (one terminator per token-type group). The fix mirrors test/lib/LibStackGeneration.sol::generateFlowStack: at the bottom of the stack, an erc1155 terminator sentinel, then erc1155 tuples; an erc721 terminator sentinel, then erc721 tuples; an erc20 terminator sentinel, then erc20 tuples. Following the previous example produced an invalid stack: consumeSentinelTuples for erc721 and erc20 would pull from below rather than terminating cleanly. Closes #424. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/interface/IFlowV5.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/interface/IFlowV5.sol b/src/interface/IFlowV5.sol index 17568fbd..bb50390d 100644 --- a/src/interface/IFlowV5.sol +++ b/src/interface/IFlowV5.sol @@ -113,13 +113,15 @@ import {UnregisteredFlow} from "../error/ErrFlow.sol"; /// ``` /// /* sentinel is always the same. */ /// sentinel: 0xfea74d0c9bf4a3c28f0dd0674db22a3d7f8bf259c56af19f4ac1e735b156974f, -/// /* erc1155 group sits at the bottom of the stack — written first in -/// rainlang, consumed last. Just a sentinel here as there's nothing to do. */ +/// /* erc1155 group at the bottom — terminator sentinel, no tuples. */ +/// _: sentinel, +/// /* erc721 group — terminator sentinel, then one tuple +/// (token, from, to, id). */ /// _: sentinel, -/// /* erc721 group sits in the middle, with the token id as the last value */ /// _: 0x1234 0xdeadbeef context<0 1>() 5678, -/// /* erc20 group sits at the top of the stack — written last in rainlang, -/// consumed first. The amount is the last value of the tuple. */ +/// /* erc20 group at the top — terminator sentinel, then one tuple +/// (token, from, to, amount). */ +/// _: sentinel, /// _: 0xf00baa context<0 1>() 0xdeadbeef 1e18; /// ``` ///