Cannot create an LP on Celo
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Bug Description
Cannot approve or add liquidity for this specific token (https://celoscan.io/address/0xcde66143c5d9b134daba0e6a96e476b1bd347b04#code). Is there an issue with the token not conforming to a specific interface?
index.ts:269 Uncaught (in promise) Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: ZERO_FIRST", method="estimateGas", transaction={"from":"0x5523058cdFfe5F3c1EaDADD5015E55C6E00fb439","to":"0xcde66143C5D9B134DabA0e6A96e476b1bD347B04","data":"0x095ea7b30000000000000000000000003d79edaabc0eab6f08ed885c05fc0b014290d95a0000000000000000000000000000000000000000000000000000000005f5e100","accessList":null}, error={"code":-32603,"message":"Internal JSON-RPC error.","data":{"code":3,"message":"execution reverted: ZERO_FIRST","data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a5a45524f5f464952535400000000000000000000000000000000000000000000"},"stack":"{\n \"code\": -32603,\n \"message\": \"Internal JSON-RPC error.\",\n \"data\": {\n \"code\": 3,\n \"message\": \"execution reverted: ZERO_FIRST\",\n \"data\": \"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a5a45524f5f464952535400000000000000000000000000000000000000000000\"\n },\n \"stack\": \"Error: Internal JSON-RPC error.\\n at new n (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:22333)\\n at s (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:26272)\\n at Object.internal (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:26882)\\n at c (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-0.js:7:44209)\\n at chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-0.js:7:45208\\n at async chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-4.js:12:54199\"\n}\n at new n (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:22333)\n at s (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:26272)\n at Object.internal (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/common-2.js:16:26882)\n at c (chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-0.js:7:44209)\n at chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-0.js:7:45208\n at async chrome-extension://ejbalbakoplchlghecdalmeeeajnimhm/background-4.js:12:54199"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
at p.makeError (index.ts:269:28)
at p.throwError (index.ts:281:20)
at v (json-rpc-provider.ts:78:20)
at ef.<anonymous> (json-rpc-provider.ts:642:20)
at Generator.throw (<anonymous>)
at a (674.588248c5.js:27:226741)
Steps to Reproduce
- Go to Add Liquidity
- 1% fee tier
- Set price range, low=1, high=2
- Starting price = 1
- Deposit amount 100 SRFTEST
- Approval fails
...
Expected Behavior
Should be able to create an LP.
Additional Context
The token contract itself is a demurrage token (The balance of users gradually decays). We do not use external erc20 libraries like OpenZepplin. The source has been published (link above).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Add Liquidity flow described in the reproduction steps and trace the approval transaction that reverts with ZERO_FIRST. Compare how this demurrage token behaves with the interface’s approval assumptions. Done means the token can be approved and used to create an LP, with coverage for the observed failure if the project supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100