Skip to content

fix(typescript): remove spurious approve() before ERC-20 transfer#729

Merged
sddioulde merged 2 commits into
mainfrom
fix/erc20-transfer-dangling-allowance
Jun 18, 2026
Merged

fix(typescript): remove spurious approve() before ERC-20 transfer#729
sddioulde merged 2 commits into
mainfrom
fix/erc20-transfer-dangling-allowance

Conversation

@sddioulde

@sddioulde sddioulde commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

ERC-20 transfer() does not require the redundant approve call. This PR removes it.

Tests

Updated unit tests.

Also successfully tested TS example evm/transactions/scopedAccount.transfer.ts.

Checklist

A couple of things to include in your PR for completeness:

  • Updated the typescript README if relevant
  • Updated the python README if relevant
  • Added a changelog entry
  • Added e2e tests if introducing new functionality

@cb-heimdall

cb-heimdall commented Jun 18, 2026

Copy link
Copy Markdown

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

⚠️ Ignored Reviews (2)

Reviewer Reason
milan-cb Old or outdated review
milan-cb Review missing MFA

@sddioulde sddioulde marked this pull request as ready for review June 18, 2026 00:13
@sddioulde sddioulde requested review from jazz-cb and milan-cb June 18, 2026 00:13
ERC-20 transfer() does not require a prior approve() — that pattern is
only needed for transferFrom(). The previous code called approve(recipient,
amount), which granted the recipient an unintended, persistent allowance
over the sender's tokens that was never consumed or revoked.
@sddioulde sddioulde force-pushed the fix/erc20-transfer-dangling-allowance branch from a6968c1 to 8ceebb1 Compare June 18, 2026 00:36
@sddioulde sddioulde merged commit 4cdbf7b into main Jun 18, 2026
49 checks passed
@sddioulde sddioulde deleted the fix/erc20-transfer-dangling-allowance branch June 18, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants