You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you deposit funds into vaults (reproduced with 3crv and ycrv), the default is an infinite approval.
However, if the user tweaks the approval to only approve the deposited amount, subsequent deposits will fail in a couple of ways
There may not be enough approved left to complete the deposit
yearn will try to approve the infinite amount again, which will always result in a failed tx if there's leftover approved amount (apparently ycrv/3crv require approval to be set to 0 before setting it to a nonzero value again to prevent frontrunning)
Suggestions:
check the approved amount beforehand, if it's nonzero but less than the required, send a tx that sets it to zero before the one that sets it to infinity
do not use infinite approvals and approve the exact amount instead, that way it's unlikely that users would tweak it
The text was updated successfully, but these errors were encountered:
When you deposit funds into vaults (reproduced with 3crv and ycrv), the default is an infinite approval.
However, if the user tweaks the approval to only approve the deposited amount, subsequent deposits will fail in a couple of ways
Suggestions:
The text was updated successfully, but these errors were encountered: