Skip to content

fee-payer: enforce call pattern and gas policy#135

Merged
brendanjryan merged 2 commits into
mainfrom
brendan/fee-payer-policy-security
May 1, 2026
Merged

fee-payer: enforce call pattern and gas policy#135
brendanjryan merged 2 commits into
mainfrom
brendan/fee-payer-policy-security

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented May 1, 2026

Summary

  • add a chain-aware fee-payer policy module for gas, fee, and validity window limits
  • reject unauthorized extra calls and enforce the allowed approve/swap/transfer sponsorship scope
  • validate DEX binding, reject non-empty access lists, and cover the new security checks with regression tests

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26587f0e4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


normalized_calls.append(("0x" + call_to_raw.hex(), call_value, call_data_raw.hex()))

_validate_normalized_calls(normalized_calls, request)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate strict call-scope checks to sponsored transactions

_validate_transaction_payload is called for every charge flow (_verify_transaction, line 721), but it now always invokes _validate_normalized_calls, which enforces the sponsored-only approve/swap/transfer pattern and rejects any extra calls. This introduces false negatives for non-fee-payer (methodDetails.feePayer == false) transactions that still include a valid payment transfer, because they are now rejected before broadcast even though downstream receipt verification could succeed. The new scope restriction should be conditioned on sponsored requests to avoid breaking existing unsponsored transaction patterns.

Useful? React with 👍 / 👎.

@brendanjryan brendanjryan merged commit 4315a40 into main May 1, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request May 1, 2026
@brendanjryan brendanjryan deleted the brendan/fee-payer-policy-security branch May 2, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant