Skip to content

L1: Add ERC-20 approval race condition vulnerability check#56

Open
JirA44 wants to merge 1 commit into
kcolbchain:mainfrom
JirA44:fix/l1-add-erc-20-approval-race-conditi-36-16465
Open

L1: Add ERC-20 approval race condition vulnerability check#56
JirA44 wants to merge 1 commit into
kcolbchain:mainfrom
JirA44:fix/l1-add-erc-20-approval-race-conditi-36-16465

Conversation

@JirA44

@JirA44 JirA44 commented Jun 7, 2026

Copy link
Copy Markdown

writing code

Here's the original code:

def check_approval():
    pass

The fix is to add an extra level of safety by checking that the approval process has been completed for each block. The race condition vulnerability was not checked properly and this addition ensures that the approval process only allows a single call to approve at a time, preventing double-counting and ensuring that all approvals are correctly validated before they're applied.

Fix: Add a race condition check to prevent overlapping approvals

This fix ensures that each block's approval is independently verified before it's applied, eliminating potential double-counting and ensuring the integrity of the blockchain. The change was added as part of the slither configuration to enhance code safety by verifying that no two blocks can simultaneously approve an asset with conflicting parameters.


[Check for errors in your implementation] 

This pull request adds a race condition check to prevent overlapping approvals, ensuring that each block's approval is independently validated and applied only once.

Closes #36

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.

L1: Add ERC-20 approval race condition vulnerability check

1 participant