Skip to content

fix(evm): Harden send calls and smart account signing#812

Merged
sidhujag merged 3 commits into
masterfrom
fix/eip5792-smart-account-safety
Jul 6, 2026
Merged

fix(evm): Harden send calls and smart account signing#812
sidhujag merged 3 commits into
masterfrom
fix/eip5792-smart-account-safety

Conversation

@sidhujag

@sidhujag sidhujag commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Add shared EVM calldata blacklist target extraction and apply it to eth_sendTransaction, wallet_sendCalls, and smart-account execution guards.
  • Use RPC custom errors for EIP-5792 57xx codes and preserve bundle status handling.
  • Improve smart-account signing compatibility by pruning unused typed-data types before hashing and add curated decoding for known ERC1155 calldata.

Test plan

  • yarn --ignore-engines test --runTestsByPath source/utils/evmCallBlacklist.spec.ts source/helpers/errors/errors.spec.ts
  • yarn --ignore-engines type-check

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pali-wallet Ready Ready Preview, Comment Jul 6, 2026 2:17am

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

Copy link
Copy Markdown

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: 5555e6589e

ℹ️ 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".

Comment thread source/utils/evmCallBlacklist.ts Outdated
Comment on lines +33 to +39
const [spender] = defaultAbiCoder.decode(
['address', 'uint256'],
calldata
);
return [
{ address: getAddress(spender), method: 'approve', type: 'approval' },
];

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 Allow ERC20 approval revocations to pass blacklist checks

When wallet_sendCalls or a smart-account execution is used to revoke an ERC20 allowance with approve(blacklistedSpender, 0), this helper still emits the spender as an approval target because it decodes only the address and ignores the allowance amount. The new callers reject high/critical blacklisted approval targets, so users can be prevented from removing exposure to a malicious spender; this also differs from the setApprovalForAll(false) handling below that correctly skips NFT revocations.

Useful? React with 👍 / 👎.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

sidhujag commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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

Copy link
Copy Markdown

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: 9ba747af75

ℹ️ 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".

Comment thread source/utils/evmCallBlacklist.ts Outdated
['address', 'uint256'],
calldata
);
if (isZeroIntegerValue(amount)) return [];

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 Don't skip ERC-721 approvals for token ID 0

When calldata is ERC-721 approve(address,uint256) for token ID 0, it uses the same selector as ERC-20 approve, but the second argument is a token ID rather than an allowance. Returning no approval target here means the blacklist middleware only checks the NFT contract target and no longer checks the approved spender, so a blacklisted operator can still be approved for token #0.

Useful? React with 👍 / 👎.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@sidhujag

sidhujag commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: b3dce096ef

ℹ️ 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".

@sidhujag
sidhujag merged commit 10ef6dc into master Jul 6, 2026
6 checks passed
@sidhujag
sidhujag deleted the fix/eip5792-smart-account-safety branch July 6, 2026 02:28
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