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

Open
prayagd opened this issue Jun 3, 2024 · 2 comments
Open

Change chain extensions to return transferable balance #483

prayagd opened this issue Jun 3, 2024 · 2 comments

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.

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

2 participants