Negative-path FlowTransferV1 construction duplicated across Flow.transfer.t.sol
Three negative-path tests in test/src/concrete/Flow.transfer.t.sol build "invalid" FlowTransferV1 structs inline (where one transfer's from is a third-party that is neither the source contract nor msg.sender). The construction blocks repeat the same shape four times:
- Lines 172-180 (ERC20:
bob → flow, flow → alice)
- Lines 187-197 (ERC20:
alice → flow, bob → alice)
- Lines 222-230 (ERC721:
bob → flow, flow → alice)
- Lines 261-274 (ERC1155:
bob → flow, flow → alice)
Each block: declare ERC{20,721,1155}Transfer[2], populate two entries with the bad from, wrap in FlowTransferV1(...), call generateFlowStack, then interpreterEval2MockCall.
test/abstract/FlowTransferOperation.sol already provides positive-path constructors (createTransferERC20toERC20, createTransferERC721ToERC721, createTransferERC1155ToERC1155) but no analogue for the third-party-from shape these revert tests need.
Fix: add createUnauthorizedERC20Transfer(address from, address to, address flow, uint256 amount) (and ERC721/ERC1155 variants) to FlowTransferOperation.sol, then call them from Flow.transfer.t.sol. Reduces 30+ lines of inline struct manipulation per test.
Negative-path
FlowTransferV1construction duplicated acrossFlow.transfer.t.solThree negative-path tests in
test/src/concrete/Flow.transfer.t.solbuild "invalid"FlowTransferV1structs inline (where one transfer'sfromis a third-party that is neither the source contract normsg.sender). The construction blocks repeat the same shape four times:bob → flow,flow → alice)alice → flow,bob → alice)bob → flow,flow → alice)bob → flow,flow → alice)Each block: declare
ERC{20,721,1155}Transfer[2], populate two entries with the badfrom, wrap inFlowTransferV1(...), callgenerateFlowStack, theninterpreterEval2MockCall.test/abstract/FlowTransferOperation.solalready provides positive-path constructors (createTransferERC20toERC20,createTransferERC721ToERC721,createTransferERC1155ToERC1155) but no analogue for the third-party-fromshape these revert tests need.Fix: add
createUnauthorizedERC20Transfer(address from, address to, address flow, uint256 amount)(and ERC721/ERC1155 variants) toFlowTransferOperation.sol, then call them fromFlow.transfer.t.sol. Reduces 30+ lines of inline struct manipulation per test.