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

Runtime constant - Minimum amount for betting #3

Open
AlexD10S opened this issue Dec 21, 2022 · 1 comment
Open

Runtime constant - Minimum amount for betting #3

AlexD10S opened this issue Dec 21, 2022 · 1 comment

Comments

@AlexD10S
Copy link
Owner

There is an issue is with the Existential Deposit when transferring the pot.

For example the pot has 10 UNITS, and has to distribute 9 UNITS to A and 1 to B. And the Existential Deposit is 2 UNITS.

Currently for the transfer we are using the flag AllowDeath which send the funds anyway the balance goes below the Existential Deposit.

T::Currency::transfer(
    &T::account_id(),
    &winner,
    amount_won,
    AllowDeath,
)?;

In that scenario, if is trying to send the fund to player A first (9 UNITS) it will success but the account will be reaped and the second will fail.

One solution to this issue can be adding a constant with minimum amount for betting and requiring it to be no less than existential deposit

@AlexD10S
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant