Skip to content

[good first issue] Add ERC-777 reentrancy test template (tokensReceived hook) #19

@abhicris

Description

@abhicris

Context

src/checks/ReentrancyCheck.sol + test/Example.t.sol cover classic ERC-20 reentrancy. We do not have a template for ERC-777's tokensReceived reentrancy vector (the same class of bug that drained imBTC/Uniswap V1 in 2020). Auditors importing this checklist currently have to write that template themselves.

Scope

Files to touch:

  • Add src/checks/ERC777ReentrancyCheck.sol — parallel to ReentrancyCheck.sol.
  • Add test/ERC777Reentrancy.t.sol — includes a deliberately-vulnerable VulnerableERC777Vault.sol fixture and asserts the check flags it.

Acceptance criteria

  • Check compiles; test passes when run against the included vulnerable fixture; test fails (= check detects bug) when fixture's nonReentrant guard is removed.
  • Documented in README.md under the checks table.

Estimated effort

M — 3-4 hrs. Reference: OZ IERC777Recipient and 2020 Uniswap V1 post-mortem.

kcolbchain / Abhishek Krishna

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions