nation3 / citizen-app

Nation3 citizen app
https://app.nation3.org
GNU General Public License v3.0
39 stars 39 forks source link

Reinstate Liquidity Rewards Program #260

Closed hhio618 closed 6 months ago

hhio618 commented 6 months ago

This will revert the changes made in commit https://github.com/nation3/citizen-app/commit/0d32b32d14abfb641907c30a2828cdd30c3794ef#diff-c929e9424c96a55187bf3c7ecec95438b67f7a6f20df177e368728ba4bbe4890

Related GitHub Issue

225

Screenshots (if appropriate):

liquidity

How Has This Been Tested?

Are There Admin Tasks?

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
citizen-app-mainnet ✅ Ready (Inspect) Visit Preview May 11, 2024 5:47am
citizen-app-sepolia ✅ Ready (Inspect) Visit Preview May 11, 2024 5:47am
vercel[bot] commented 6 months ago

@hhio618 is attempting to deploy a commit to the Nation3 DAO Team on Vercel.

A member of the Team first needs to authorize it.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 11.79%. Comparing base (110ad98) to head (f035479).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #260 +/- ## ======================================= Coverage 11.79% 11.79% ======================================= Files 18 18 Lines 356 356 Branches 80 77 -3 ======================================= Hits 42 42 - Misses 308 314 +6 + Partials 6 0 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hhio618 commented 6 months ago

Please test using the latest commit.

aahna-ashina commented 6 months ago

@hhio618 I'm getting a division-by-zero error at https://citizen-app-sepolia-i57i145rj-nation3dao.vercel.app/liquidity

Is that because of the Reward APY being zero?

hhio618 commented 6 months ago

@aahna-ashina I'm not sure! Please send me the testnet token so that I can test this further. My eth address: 0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605

aahna-ashina commented 6 months ago

Please send me the testnet token so that I can test this further.

@hhio618 Here is how to get testnet tokens: https://github.com/nation3/.github/blob/main/CONTRIBUTING.md

hhio618 commented 6 months ago

@aahna-ashina Found the issue, the totalDeposit is zero in this contract: https://sepolia.etherscan.io/address/0x5514cF24D2241Ecc6012306927eA8d74E052416D#readContract. This value is being used for division in this code: https://github.com/nation3/citizen-app/blob/833fc2215aea6fa42afda8d76c6b9d63b1faee21/ui/lib/liquidity-rewards.ts#L75.

aahna-ashina commented 6 months ago

Found the issue, the totalDeposit is zero in this contract: https://sepolia.etherscan.io/address/0x5514cF24D2241Ecc6012306927eA8d74E052416D#readContract. This value is being used for division in this code: https://github.com/nation3/citizen-app/blob/833fc2215aea6fa42afda8d76c6b9d63b1faee21/ui/lib/liquidity-rewards.ts#L75.

@hhio618 Okay, thank you. So if we make a deposit, the error message should disappear?

hhio618 commented 6 months ago

@aahna-ashina You're welcome! Yes, Just add tokens using the deposit method, which will do the trick!