Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

DepositSection should check if allowance is high enough; not just if it is more than 0 #480

Open
ReflectiveChimp opened this issue May 28, 2021 · 0 comments

Comments

@ReflectiveChimp
Copy link

ReflectiveChimp commented May 28, 2021

Currently the allowance is hard coded to 8000000000 'ether' [1]; user can manually override this in their wallet.

Ideally user could choose to allow an amount equal to their deposit, or allow unlimited (á la 1inch). Hard coding to unlimited would be helpful in the short term.

Either way; the DepositSection should check if the allowance is greater than the amount to be deposited; rather the current check of greater than 0 [2][3][4].

[1]

.approve(contractAddress, web3.utils.toWei('8000000000', 'ether'))

[2]

isNeedApproval: new BigNumber(
tokens[eligibleTokens[0].symbol].allowance[pool.earnContractAddress]
).isZero(),

[3]

isNeedApproval: allowance.isZero() || prevState.amount.isGreaterThan(allowance),

[4]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant