HomePhabricator

[Cashtab + token-server + ecash-coinselect] Implement token rewards for Cashtab…

Description

[Cashtab + token-server + ecash-coinselect] Implement token rewards for Cashtab users

Summary:
T2838

Implement claimable token rewards for users of Cashtab. A valid ecash address may claim a reward every 24 hours.

Summary of changes to get this feature

  • In Cashtab, we add a new "Rewards" screen. The screen displays a button "Claim Rewards" if the user is eligible (no claimed rewards for 24 hours). If ineligible, a countdown is displayed to when eligibility returns.
  • In token-server, we add the logic to build and broadcast a token reward. We add an endpoint to summon a token reward tx to an address, if it is eligible.
  • In ecash-coinselect, we add stub type declarations, so typescript applications (like token-server) can still build if they are using it.

I have tested this locally. Able to claim rewards, see countdown for ineligible address, get expected error msg if the server is out of money. It is tricky to test the full stack locally. You will need to create your own token, change URL in cashtab, change wallet settings in token-server. If you really want to do this for hobbyist reasons, ping me on Telegram. Otherwise, it is probably best to land this when we will both be available for at least an hour.

DM me with any concerns about DOSing or draining the rewards faucet. Since the cost of token rewards is relatively low (we can test more than 10,000 rewards for less than $10), I am in favor of launching, then dealing with "attacks" as they emerge.

Test Plan: npm test

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D15997

Details

Provenance
bytesofmanAuthored on Tue, Apr 16, 22:15
bytesofmanPushed on Thu, Apr 18, 12:22
Reviewer
Restricted Project
Differential Revision
D15997: [Cashtab + token-server + ecash-coinselect] Implement token rewards for Cashtab users
Parents
rABC09ee00dbb2ca: validation tests: Use existing {Chainstate,Block}Man
Branches
Unknown
Tags
Unknown