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

EulerETokenMock deposit() bug #7

Open
daejunpark opened this issue Oct 4, 2022 · 1 comment
Open

EulerETokenMock deposit() bug #7

daejunpark opened this issue Oct 4, 2022 · 1 comment

Comments

@daejunpark
Copy link

convertToShares(amount) should be executed before the token transfer; otherwise, it mints less shares than it should (except the very first deposit).

function deposit(uint256, uint256 amount) external override {
// call EulerMock to transfer tokens from sender
euler.transferTokenFrom(underlying, msg.sender, address(this), amount);
// mint shares
_mint(msg.sender, convertToShares(amount));
}

@daejunpark
Copy link
Author

Fix suggestion: daejunpark@721cf4b

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