Skip to content

fix(contracts): add zero-amount + fee-on-transfer checks in PaymentEscrow#5368

Closed
michaelxmchn wants to merge 2 commits into
ClankerNation:mainfrom
michaelxmchn:fix/payment-escrow-179-v2
Closed

fix(contracts): add zero-amount + fee-on-transfer checks in PaymentEscrow#5368
michaelxmchn wants to merge 2 commits into
ClankerNation:mainfrom
michaelxmchn:fix/payment-escrow-179-v2

Conversation

@michaelxmchn

Copy link
Copy Markdown

/claim #179
💳 Payment: USDC | 0x301c9f7ebb1b937901adf96a144553f95e89e145 | Base

Fixes #179 — security hardening for PaymentEscrow.

  • Zero-amount check: require(amount > 0, "Amount must be > 0")
  • Token validation: require(token != address(0), "Invalid token")
  • Fee-on-transfer: balance-before/after pattern for actual received amount
  • SafeERC20: safeTransferFrom/safeTransfer instead of raw transfer calls
  • Contributor traceability: traceability headers in all modified files

Test Plan

14 new tests covering: zero amount rejection, invalid payee/token, fee-on-transfer lifecycle, standard ERC20 flow, double-settlement protection, lock period enforcement — 14/14 PASS.

🤖 Generated with Claude Code

michael and others added 2 commits June 18, 2026 12:45
…ymentEscrow

- Add balance-before/after pattern in createEscrow to handle fee-on-transfer
  tokens — store actual received amount instead of nominal input amount
- Add SafeERC20 import + using directive for safe transfer wrapper
- Add contributor metadata @Custom: tags for CI traceability
- Add FeeOnTransferToken mock (5% burn) for comprehensive test coverage
- Add PaymentEscrow test suite: 14 tests covering zero-amount rejection,
  invalid addresses, standard ERC20 lifecycle, fee-on-transfer deposit/
  release/refund, double-settle protection, and access control
- Fix hardhat.config.js for multi-version Solidity (0.8.20 + 0.8.24/cancun)
- Fix ChainlinkAdapter.sol tuple destructuring for Solidity 0.8.24 compat

Closes ClankerNation#179

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ention

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request within 2 hours.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting.

@github-actions github-actions Bot closed this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $4k ] [ Solidity ] Fix missing zero-amount check in PaymentEscrow createEscrow — testnet finding

1 participant