Open AlexD10S opened 1 year ago
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
Issue in StackExchange: https://substrate.stackexchange.com/questions/6436/fund-a-pallet-accountid
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.
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