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)); |
|
} |
convertToShares(amount)should be executed before the token transfer; otherwise, it mints less shares than it should (except the very first deposit).yield-daddy/src/test/euler/mocks/EulerETokenMock.sol
Lines 28 to 34 in 27a67fd