Skip to content

erc20_transfers collect_by_transaction uses Approval signature instead of Transfer signature #231

Open
@ChadRosseau

Description

@ChadRosseau

Description
In erc20_transfers.rs, the is_erc20_transfer function on line 101 is as follows:

fn is_erc20_transfer(log: &Log) -> bool {
    log.topics().len() == 3 &&
        log.data().data.len() == 32 &&
        log.topics()[0] == ERC20::Approval::SIGNATURE_HASH
}

Note that it checks for an Approval log signature hash instead of a Transfer signature hash. Since this function is used in CollectByTransaction, it will incorrectly collect Approval logs instead of Transfer logs.

Line 104 should instead be as follows, which mirrors the check on line 62 for CollectByBlock:

log.topics()[0] == ERC20::Transfer::SIGNATURE_HASH

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions