Page MenuHomePhabricator

[Cashtab] Support slpv1 mint txs
ClosedPublic

Authored by bytesofman on Mar 31 2024, 05:36.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC4aa520f69ef2: [Cashtab] Support slpv1 mint txs
Summary

T1711

Support slpv1 mint txs

If user does not have mint baton for given token, disable the switch

Always mint with a created mint baton.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
support-mint-txs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28212
Build 55969: Build Diffcashtab-tests
Build 55968: arc lint + arc unit

Event Timeline

bytesofman added inline comments.
cashtab/src/components/Send/__tests__/SendToken.test.js
625

image.png (665×793 px, 80 KB)

validate mint amounts with separate function, only use 1 mint baton if user has more

emack requested changes to this revision.Mar 31 2024, 13:16
emack added a subscriber: emack.
emack added inline comments.
cashtab/src/components/Send/SendToken.js
910 ↗(On Diff #46670)

Probably for another diff - currently if you burn the entire supply for a variable supply token, it stays in the token list with the 0 supply until you mint again, which is expected. However should we have an option to completely burn the variable supply token by burning the mint baton?

cashtab/src/slpv1/index.js
408 ↗(On Diff #46670)
  1. Mint with max allowed supply
  2. Click max again and it lets you mint this max supply once more
  3. Rinse and repeat with no limit, very quickly reaching quintillion token amounts.

image.png (667×577 px, 93 KB)

This revision now requires changes to proceed.Mar 31 2024, 13:16
bytesofman marked an inline comment as done.
bytesofman added inline comments.
cashtab/src/components/Send/SendToken.js
910 ↗(On Diff #46670)

Yes, we can add this later if people want it. imo we don't really need to give general users more burn options, but it wouldn't be too complex so it could get in.

cashtab/src/slpv1/index.js
408 ↗(On Diff #46670)

how does this work in practice? at some point I guess chronik calls it an invalid tx?

Need to better understand how chronik follows the spec on this. We probably should have some validation or at least warnings about this. However, can be after this diff. Will require functions that make chronik calls to check the token's circulating supply.

I think it's ok to launch without this and leave that to the spec / reference indexers for now.

This revision is now accepted and ready to land.Mar 31 2024, 13:26
This revision was automatically updated to reflect the committed changes.
bytesofman marked an inline comment as done.