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

[Native Banker] Implement TotalCoin #2662

Open
leohhhn opened this issue Aug 6, 2024 · 2 comments
Open

[Native Banker] Implement TotalCoin #2662

leohhhn opened this issue Aug 6, 2024 · 2 comments
Labels
help wanted Want to contribute? We recommend these issues.

Comments

@leohhhn
Copy link
Contributor

leohhhn commented Aug 6, 2024

Description

This issue concerns the implementation of the TotalCoin function in the native Gno banker. This function should return the total supply of a specific coin given its denomination.

Reference code can be found here.

@DIGIX666
Copy link
Contributor

DIGIX666 commented Aug 8, 2024

Hello !
I've tried to solve this problem with #2670
I hope I had the right approach :)

@deelawn
Copy link
Contributor

deelawn commented Aug 14, 2024

I'm not sure if we want this. I just took a look how ERC-20 tokens work and the contract must implement the IERC20 interface that has a method called totalSupply() -- I kind of like the total coins issued being encapsulated in the token definition itself rather than having to rely on the protocol to maintain this information; it forces the author to bear the responsibility of any additional storage cost incurred, which is, in this case, the total token count value. It also gives the realm that mints the coin the autonomy to determine whether or not they want to expose the total token count. I'm can't think of a reason why they'd want to do this but maybe they would?

So here is what I'm getting at -- could we just rely on the existing Banker in the GRC20 package to manage all of this? If the realm that created the token wants to expose its read-only methods, they can. Or maybe we can implement better GRC20 banker security so that the owning realm can export it with the assurance that calling modifying methods can only be done by the users authorized to do so -- then anyone could import the realm owning the token and read all of its properties.

I've changed my mind on this after a few discussions.

@leohhhn leohhhn changed the title [Banker] Implement TotalCoin [Native Banker] Implement TotalCoin Aug 14, 2024
@Kouteki Kouteki modified the milestone: 💡Someday/Maybe Oct 2, 2024
@Kouteki Kouteki added help wanted Want to contribute? We recommend these issues. and removed help wanted labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Want to contribute? We recommend these issues.
Projects
Status: Triage
Development

No branches or pull requests

4 participants