Giter Site home page Giter Site logo

citycoins-ui's People

Contributors

friedger avatar whoabuddy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

friedger

citycoins-ui's Issues

⚑[FEAT] Enable mining and stacking dashboards

Is your feature request related to a problem? Please describe.

The old version of the site had a dashboard with components that were reused across a few pages.

Describe the solution you'd like

This should be restored in it's original state, but exploring #4 in the next iteration would be interesting as well.

🐞[BUG] mining claims: "cannot find city ID for city"

Describe the bug
Seeing a few reports in Discord on this one:

Attempted to get mining rewards and got β€œCannot find city ID for city.” Didn’t see many posts on it, any workarounds to claim citycoins? I am showing 100 blocks have passed too (BabyGotStacks#1157)

I'm having a hard time claiming MIA blocks that have been won. I've logged out, cleared cache etc. Am I in the wrong spot? Feeling like I'm missing something really simple.
I'm getting the same error "Cannot find City ID" on MineCityCoins. I do have MIA selected.
I've been able to claim via the sandbox in the meantime - user error?
More so asking in case it may help others having the same woes. (Coin Latifah#2691)

I won the some blocks how to get a mia?? (Luckyboy#7897)

image0

image0

To Reproduce

TBD - need to evaluate against block heights being claimed. The city ID mentioned above is only relevant to the DaoV1 contracts and should not be checked for LegacyV1/LegacyV2.

Expected behavior

The mining claim will call the correct contract based on block height.

🐞[BUG] (Race Condition Issue) Claiming your Stacked CC before FAST Pool Reward Payout = 0 STX Rewards

Bug Description:
This is a race condition type of problem where the user is able to claim their stacked MIA/NYC/CityCoins before Friedger's FAST Pool pays out the treasury stacking rewards. Because the user claim's their CityCoins before the calculation is done, their stacked CC is set to 0, so the resulting Stacking rewards is then calculated as 0.

Steps to reproduce the behavior:

  1. Stack your CC.
  2. When the last cycle is completed, claim your CC before the FAST Pool pays out the stacking rewards.
  3. Checking your rewards for this last cycle will show 0.

Expected behavior:
The user is unable to claim their CC until the FAST Pool pays out the stacking rewards.

Device:
Windows 11, Brave Browser

Possible solutions:

  1. Set an arbitrary minimum limit where the user is unable to claim for X amount of blocks after the cycle ends. Maybe something like 200 blocks; if a user checks their rewards on minecitycoins.com, it will show the CC to reclaim, but the button should be greyed out and say something along the lines of, "Please wait to claim until Stacks block XXXXXX."
  2. Similar to the above, but instead of the minimum limit being arbitrary like 200 blocks, we read the FAST Pool TxID data and get the Anchor Block the Tx was confirmed in. The greyed out button should also show something like, "Please wait to claim until Stacks block XXXXXX." But instead of XXXXXX being the CycleEndBlock + 200 Stacks blocks, it would be the CycleEndBlock + FastPoolConfirmedAnchorBlock.

🐞[BUG] Config not defined

Describe the bug
When trying to claim stacking reward, no popup appears and I see this error in the log:

Uncaught (in promise) TypeError: n.config is undefined
    e StackingReward.js:47
    f runtime.js:63
    _invoke runtime.js:293
    M runtime.js:118
    Babel 2
2 [StackingReward.js:47:8](https://minecitycoins.com/static/js/components/stacking/StackingReward.js)

​

⚑[FEAT] use jotai and KV for state management

Is your feature request related to a problem? Please describe.

A lot of the data stored on the page is queried more often then it needs to be, and only stored in localstorage.

Describe the solution you'd like

See if it's possible to use a loadable atom to track global state, such that:

  • the atom config is stored in KV as a JSON object
  • the loadable util helps track state of atom
    • if loading, return current value, show status/spinner? race condition? by back-end?
      • fetch on backend for base atom(s), derive atom used for state in app
    • if hasData and lastBlock < currentBlock, update, set, return value
    • if hasError, retain last value, return last value, log? show?
  • the front-end reads/loads the data from KV, and can trigger loading on mismatch
    • make sure loading operation can only fire once until state updated

Describe alternatives you've considered

It works as-is, but this model would help bring in more data from the contracts, and set a foundation for exposing more data in the UI.

🐞[BUG] Minecitycoins UX Claim Button

The minecitycoins.com website shows users the "Claim" button on the last delegated stacking cycle they stacked for, rather than appearing in the subsequent cycle where the CityCoins will actually unlock. This is a UX issue where users think they can claim their CityCoins, but the transactions will fail (user loss of fees) because the CityCoins are still being stacked in that last cycle.
UX Bug

The following error for the failing transaction is:

This transaction would have succeeded, but was rolled back by a supplied post-condition.

This bug can be seen on the Stacks Explorer.

  • Delegation TxID: 0x033e7d7f4b9bddaec27357a3c4bff5a9edac1d917ec9cd04d4a5f0f976ef3f5c
  • Failed Claim TxID: 0xc896ad5b89be372900f4141cf30f9152e82560dc2b8c028c0e5871390bacf358

🐞[BUG] Limit total mining fields to 200

Describe the bug

Right now you can specify any number of blocks for a mining transaction, and it will let someone fill in the values then show an error at submission.

To Reproduce
Steps to reproduce the behavior:

  1. Go to minecitycoins.com
  2. Log in with a Stacks wallet
  3. Click on MIA, then Mining
  4. Enter more than 200 blocks to mine

Expected behavior

This check could be performed when the text field is updated, which is already captured to generate the needed form fields.

Screenshots

image

🐞[BUG] Stacking claims have incorrect function arguments

Describe the bug

Reported in Discord - stacking claims do not include the city name in the function arguments, causing the call to fail:

// submit tx
await doContractCall({
contractAddress: citySettings.config.stacking.deployer,
contractName: citySettings.config.stacking.contractName,
functionName: citySettings.config.stacking.stackingClaimFunction,
functionArgs: [targetCycleCV],

To Reproduce
Steps to reproduce the behavior:

  1. Go to minecitycoins.com
  2. Try to claim a stacking reward from the new contract

Expected behavior

These fields should adjust based on the contract being called. LegacyV1 and LegacyV2 only require the target cycle, whereas DaoV1 needs both the city name and the target cycle.

Screenshots

minecitycoins UI:

Screenshot_2023-03-21_at_8 14 38_AM

sandbox:

Screenshot_2023-03-21_at_8 15 01_AM

🐞[BUG] Mining claims - incorrect function argument

Describe the bug

Reported in Discord.

Yes, I tested now, It accured new trasaction for claim, but I got an error as below
Same as above over here. Nonce is correct i.e. +1 of my last executed

Expected behavior

A successful transaction.

Screenshots

SmartSelect_20230306_131218_Kiwi_Browser

⚑[FEAT] Use bitcoin block heights

Describe the solution you'd like

There should be a current BTC block atom/component, which could be used alongside the stacking data to show cycle start, cycle end, and progress.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.