fix(evm): Harden send calls and smart account signing#812
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| const [spender] = defaultAbiCoder.decode( | ||
| ['address', 'uint256'], | ||
| calldata | ||
| ); | ||
| return [ | ||
| { address: getAddress(spender), method: 'approve', type: 'approval' }, | ||
| ]; |
There was a problem hiding this comment.
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>
|
@codex review |
|
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. |
There was a problem hiding this comment.
💡 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".
| ['address', 'uint256'], | ||
| calldata | ||
| ); | ||
| if (isZeroIntegerValue(amount)) return []; |
There was a problem hiding this comment.
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>
|
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
eth_sendTransaction,wallet_sendCalls, and smart-account execution guards.Test plan
yarn --ignore-engines test --runTestsByPath source/utils/evmCallBlacklist.spec.ts source/helpers/errors/errors.spec.tsyarn --ignore-engines type-checkMade with Cursor