Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERC7540Vault] Wrong parameters in Deposit event #417

Open
eyqs opened this issue Oct 10, 2024 · 0 comments
Open

[ERC7540Vault] Wrong parameters in Deposit event #417

eyqs opened this issue Oct 10, 2024 · 0 comments

Comments

@eyqs
Copy link

eyqs commented Oct 10, 2024

The current implementation of deposit in ERC7540Vault.sol is:

function deposit(uint256 assets, address receiver, address controller) public returns (uint256 shares) {
    _validateController(controller);
    shares = manager.deposit(address(this), assets, receiver, controller);
    emit Deposit(receiver, controller, assets, shares);
}

But the ERC-7540 spec states that:

When the Deposit event is emitted, the first parameter MUST be the controller, and the second parameter MUST be the receiver.

The correct implementation should match the ERC-4626 spec, where controller has exchanged assets for shares (on behalf of owner in requestDeposit) and transferred those shares to receiver:

emit Deposit(controller, receiver, assets, shares);
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

No branches or pull requests

1 participant