Repository navigation
fix(tasks): fund a new task, bounty or pool through vAPI's ERC-3009 intent - #121
Merged
Merged
Conversation
…ntent
Where vAPI serves ERC-3009 funding (Base mainnet), the first funding of a new
order is one ReceiveWithAuthorization to the clone's predicted address; the
clone is created after the signature is confirmed. The plan guard refused
every such intent ("The V2 target is not registered by the locally pinned
factory"), so the CLI and local MCP could not fund any new task, bounty or
pool there.
The guard now treats the intent like the approval of a fresh clone: it
derives the creation arguments from the accepted terms and the pinned
factory's live fee, and signs only when the pinned factory predicts the
intent's address for them. The authorization can only be redeemed by that
address, which exists only as the clone of exactly those arguments.
The signing-block deadline check of a task now reads MIN_WORK_TIME from the
factory implementation while the clone does not exist, and covers the
accepted milestones instead of an empty list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: vAPI Development <336934719+vapi-development@users.noreply.github.com>
A first funding creates the clone from vAPI's copy of the order. `post --fund` in the CLI and MCP now passes the order it posted (title, brief, deadline, shape, milestones, bounty or pool terms, worker bond) into the executor, which refuses to sign when vAPI's order differs on any of them. A changed reward, verifier, split or deadline can no longer reach a signature through the approval or the ERC-3009 path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vAPI Development <336934719+vapi-development@users.noreply.github.com>
The check compared a subset of fields and missed others that feed the terms hash, so it gave a false sense of binding. Binding a first funding to the order this client posted moves to its own change, for the approval and the ERC-3009 path together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vAPI Development <336934719+vapi-development@users.noreply.github.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Base mainnet vAPI prepares the first funding of a new order as one EIP-3009
ReceiveWithAuthorizationto the clone's predicted address, and creates the clone after the signature is confirmed. The plan guard refused every such intent withv2_plan_mismatch: The V2 target is not registered by the locally pinned factory., sovapi task post --fundandvapi task fundcould not fund any new task, bounty or pool there. Nothing was signed; the refusal came first.Fix (
packages/core/src/tasks/v2-plan-guard.ts)MIN_WORK_TIMEfrom the clone, which does not exist yet, and checked an empty milestone list. It now reads the factory implementation and checks the accepted milestones.Tests (written first, red on
main): a new task escrow funded by one authorization andcreateAndFundWithAuthorization; a new open vAPI ID pool funded by one authorization, thencreatePoolandfundWithAuthorization; a refusal when the pinned factory predicts another address. Core: 2598 passed, typecheck, lint and format clean.🤖 Generated with Claude Code
follow-up: bind a first funding to the order this client posted (persist the posted order in the journal and compare the creation arguments and terms hash computed from it) for the approval and ERC-3009 paths. A field-level check was tried in this PR and reverted: it missed fields that feed the terms hash and could be skipped on resume.
follow-up: add a bounty-specific first-funding-by-authorization test.