yearn / yearn-vaults-v2-subgraph

26 stars 41 forks source link

Fix/incorrect tokenamount for deposit #122

Closed bsamuels453 closed 2 years ago

bsamuels453 commented 2 years ago

This PR addresses https://github.com/yearn/yearn-vaults-v2-subgraph/issues/99

There are commits in this PR from PR #121, so I recommend merging that one first before looking at this one's diff.

Synopsis: handleDepositWithAmount and handleDepositWithAmountAndRecipient would use incorrect values for depositedAmount when the amount is uint256.max. The Vault logic for deposit() handles this case by treating these deposits as a deposit() call.

The issue is addressed by doing the same thing for handleDepositWithAmount and handleDepositWithAmountAndRecipient when the value passed to the call is uint256.max.

bsamuels453 commented 2 years ago

test run:

image