Skip to content

Are there any bugs in the AnyswapV4ERC20.sol? #104

@xuebingqing

Description

@xuebingqing

Description

When we recently used the fuzz testing tool, we scanned the contract AnyswapV4ERC20.sol. We found some issues and wanted to confirm with you.

    function depositWithPermit(address target, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s, address to) external returns (uint) {
        IERC20(underlying).permit(target, address(this), value, deadline, v, r, s);
        IERC20(underlying).safeTransferFrom(target, address(this), value);
        return _deposit(value, to);
    }

WETH does not implement the permit function specified by ERC20 and implements the fallback function. At the same time, the permit function has no return value, so no error will be reported when calling WETH's permit function. If the underlying address is the address of the WETH contract, will there be such a problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions