Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.
This repository was 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

@ReflectiveChimp

Description

@ReflectiveChimp

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions