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

Change chain extensions to return transferable balance #483

Closed
prayagd opened this issue Jun 3, 2024 · 6 comments · Fixed by #501
Closed

Change chain extensions to return transferable balance #483

prayagd opened this issue Jun 3, 2024 · 6 comments · Fixed by #501
Assignees

Comments

@prayagd
Copy link
Collaborator

prayagd commented Jun 3, 2024

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
Copy link
Collaborator Author

prayagd commented Jun 3, 2024

@ebma Please fill in the details

@ebma
Copy link
Member

ebma commented Jun 5, 2024

I updated the description @prayagd.

@prayagd
Copy link
Collaborator Author

prayagd commented Jul 22, 2024

@vadaynujra
Copy link

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

@TorstenStueber
Copy link
Member

No, it applies to all assets.

@TorstenStueber
Copy link
Member

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

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

Successfully merging a pull request may close this issue.

5 participants