-
Notifications
You must be signed in to change notification settings - Fork 398
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
feat: On-Chain Airdrop checker [WIP] #3899
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: moul <[email protected]>
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
If you add TotalSupply in this PR, just linking this PR as well for the docs: #2661 |
can we stop using the term "airdrop" for this feature (PR title, and a unit test having the term in the title); this PR isn't an airdrop checker, but a balance checker. |
) | ||
|
||
// TotalSupply returns the total supply of the specified denomination | ||
func TotalSupply(banker std.Banker, denom string) int64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have this API instead, and always use a readonly banker?
func TotalSupply(banker std.Banker, denom string) int64 { | |
func TotalSupply(denom string) int64 { |
} | ||
|
||
func renderHomepage() string { | ||
return `# Gno.land Coins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homepage should give some information, and provide default links so that we can try the features with just a few clicks.
## Total Supply | ||
` + std.NewCoin(denom, totalSupply).String() + ` | ||
|
||
[Back to Home](/r/gnoland/coins:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
back is already available in the navigation breadcrumb.
[Back to Coin Info](/r/gnoland/coins:` + denom + `) | ||
[Back to Home](/r/gnoland/coins:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this, we should use the navigation breadcrumb for this.
} | ||
|
||
for _, tt := range tests { | ||
banker := std.NewBanker(std.BankerTypeRealmIssue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to initialize a banker from this realm?
(if there is a good reason, why not a readonly one?)
for _, acc := range accounts { | ||
if acc == nil { | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not scalable. We need to find a more efficient solution, or we should refrain from offering this feature for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check comments.
Description
Implements a basic airdrop checker functionality. The implementation follows a "Reader-only realm" pattern and provides simple APIs for checking token balances and total supply.
WIP
Key Changes
TotalSupply()
method to get total supply of a specific denominationAddressBalance()
method to get balance of an address for a specific denomination