Skip to content

ERC4626 should allow overriding transfers in and out #5960

@arr00

Description

@arr00

🧐 Motivation
ERC4626 directly interacts with the ERC20 tokens in the _deposit and _withdraw functions. This requires one to override and not call super if they are changing how underlying assets are managed.

📝 Details

SafeERC20.safeTransfer(IERC20(asset()), receiver, assets);

SafeERC20.safeTransferFrom(IERC20(asset()), caller, address(this), assets);

Would prefer if these lines instead called another internal function, which is dedicated to doing transfer in and outs. The specific usecase I'm working with the vault is staking the tokens in another contract. I assume this is a relatively common usecase. We should strive for super to always be called for _deposit and _withdraw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions