Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token buying error #6415

Open
bedeho opened this issue Jul 8, 2024 · 5 comments
Open

Token buying error #6415

bedeho opened this issue Jul 8, 2024 · 5 comments
Assignees
Labels
bug Something isn't working pending-triage Requires triage before any work can begin

Comments

@bedeho
Copy link
Member

bedeho commented Jul 8, 2024

Check out this token: https://gleev.xyz/channel/25941?tab=Token

Currently, it is possible to buy from the AMM, as no revenue split is claimed to be occuring in the UI

Screenshot 2024-07-08 at 16 07 18

None the less, a user (memberId: "8") tried to buy the token just now, and failed, and got the error in the UI that it was not possible to do it due ot token suppl changing or something, basically the user could execute the trade on the UI, but the result was rejected by the runtime - at least as indicated by the UI. This error mode should really only happen when te state of the runtime changes after the user has loaded the token page. HEre is the console error:

Screenshot 2024-07-08 at 4 59 05 PM

It seems the issue here is that either the application mistakenly believes the transaction was rejected, or it incorrectly allowed the user to start the trade to begin with.

@bedeho bedeho added bug Something isn't working pending-triage Requires triage before any work can begin labels Jul 8, 2024
@ikprk
Copy link
Collaborator

ikprk commented Jul 9, 2024

I took a look at runtime code and it looks like runtime only allows to start trading after the revenue share is finalized. Which I'd say is a bug, since after the revenue share ends changing the supply doesn't matter, at least to my knowledge. Atlas was checking the ending block and comparing it to the current block, so the creator doesn't have to finalize the revenue share with a transaction for holders to start trading.

@bedeho
Copy link
Member Author

bedeho commented Jul 9, 2024

Can you link to the explicit line you have in mind which has the check you are referring to, also remind me, what do you mean when you say a revenue share is "finalized", do you mean that its over? Because I thought we had alread looked at this before and determined that this was indeed not required, as the runtime is easil able to determine this itself.

@ikprk
Copy link
Collaborator

ikprk commented Jul 9, 2024

Can you link to the explicit line you have in mind which has the check you are referring to, also remind me, what do you mean when you say a revenue share is "finalized", do you mean that its over? Because I thought we had alread looked at this before and determined that this was indeed not required, as the runtime is easil able to determine this itself.

Buy on amm: https://github.com/Joystream/joystream/blob/dabaa45c97409874ebe862f4e0198fb85faefa2d/runtime-modules/project-token/src/lib.rs#L855

Validation fn: https://github.com/Joystream/joystream/blob/dabaa45c97409874ebe862f4e0198fb85faefa2d/runtime-modules/project-token/src/types.rs#L1352

@bedeho
Copy link
Member Author

bedeho commented Jul 9, 2024

@ignazio-bovo can you weigh in here?

I don't see why the creator would have to do anything to finalize the revenue split, because the revenue split finishes at a known time, so runtime should just be able to compare current block to sum of block height when split started and block duration of split. At the same time, it does look the implementation requires the creator to deactivate.

If this is indeed the case, then we should send an email, and send it recurringly as long as an expired split has not been finalized.

@bedeho
Copy link
Member Author

bedeho commented Jul 10, 2024

It seems this issue also is in effect when you try to sell or buy from portfolio page, you are allowed to try buying/selling despite it not being possible, so it should be fixed there as well some how, not sure how to handle it UI wise, but def. we cant allow people to try to execute trades that just cause failed tx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-triage Requires triage before any work can begin
Projects
None yet
Development

No branches or pull requests

2 participants