pooltogether / pooltogether-community-ui

UI to use when creating your own custom pools, prize strategies or as reference code for integrating your own pools.
https://pooltogether.com
MIT License
45 stars 47 forks source link

Error with "Deposit" - See JS Console for details #68

Open iam-dev opened 3 years ago

iam-dev commented 3 years ago

1) Create a new pool with ERC20 contract on Binance smart chain (Testnet). 2) Deposit ERC20 3) Error occurred, see also screenshot { "code": -32603, "message": "Internal JSON-RPC error.", "data": { "code": -32000, "message": "gas required exceeds allowance (30000000) or always failing transaction" } }

iam-dev commented 3 years ago

https://reference-app.pooltogether.com/pools/bsc-testnet/0xaceefb3360461df141d73e269b7938718c744019/home#deposit

chuckbergeron commented 3 years ago

@iam-dev hey thanks for the bug report, could you send some of this test SAFEMOON token (0xa08Ea1464870dAe57985F67FEE342d44dAd030b2) to 0x5E6CC2397EcB33e6041C15360E17c777555A5E63 ? Thanks!

iam-dev commented 3 years ago

0x5E6CC2397EcB33e6041C15360E17c777555A5E63

https://testnet.bscscan.com/tx/0xe9354ab7989ab55514509ecd87f538ae4b441ece7a2563b263401ab707090037

chuckbergeron commented 3 years ago

Looks like I was able to deposit no problem. You mentioned that depositing doesn't work? Do you have a transaction hash of the failing tx, or is it just that you can't even get to submitting the tx?

Screenshot 2021-05-10 at 12 11 15
iam-dev commented 3 years ago

https://community.pooltogether.com/pools/bsc-testnet/0x5cd7d24bca4bea87378b6326115511fd98274da8

try this one, with alot of deposit.

image1

image0

moonery-dev commented 3 years ago

this should be the issue: https://github.com/pooltogether/pooltogether-community-ui/blob/abbe3fa70a9f2028c2ed7621562f324777aaa19c/lib/components/DepositForm.jsx#L213

const params = [prizePoolAddress, ethers.utils.parseUnits('1000000000', decimals)]

You cannot send more than approve amount, the approve amount has max of 1000000000.

chuckbergeron commented 3 years ago

When I looked at it it was that the numberWithCommas lib doesn't support that many decimal places of precision. If someone wanted to update the code to support currencies such as SAFEMOON where 1,000,000,000,000,000,000~ is a normal amount then a pull request or two would be welcomed!