pendulum icon indicating copy to clipboard operation
pendulum copied to clipboard

Change chain extensions to return transferable balance

Open prayagd opened this issue 1 year ago • 6 comments

Context

Related to this ticket. Fixes to be made so that Nabla modals should show up as transferrable balance.

Our chain extension exposes functions conforming to the ERC-20 interface. In ERC-20, the only function to get the balance of an address is using the balanceOf() call. At the moment, we are returning the 'free' balance of a user, see here. However, the free_balance is not necessarily the transferable balance, as it does not take into account the locked or reserved tokens.

See the relation of the system::account() query to the transferable amount. image

image

TODO

Change the balance_of function of the chain extension to return the transferable amount ie. free - reserved - frozen.

prayagd avatar Jun 03 '24 11:06 prayagd

@ebma Please fill in the details

prayagd avatar Jun 03 '24 11:06 prayagd

I updated the description @prayagd.

ebma avatar Jun 05 '24 08:06 ebma

Hey team! Please add your planning poker estimate with Zenhub @b-yap @bogdanS98 @ebma @gianfra-t @TorstenStueber

prayagd avatar Jul 22 '24 09:07 prayagd

Does this only apply to when the native asset (PEN) is part of Nabla @ebma ?

vadaynujra avatar Sep 26 '24 09:09 vadaynujra

No, it applies to all assets.

TorstenStueber avatar Sep 26 '24 11:09 TorstenStueber

I think it is actually good to implement this soon, now that Nabla will be live on Pendulum.

TorstenStueber avatar Sep 26 '24 11:09 TorstenStueber