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

Featuring Memecoin #62

Merged
merged 5 commits into from
Jan 8, 2024
Merged

Featuring Memecoin #62

merged 5 commits into from
Jan 8, 2024

Conversation

bgodlin
Copy link
Contributor

@bgodlin bgodlin commented Jan 4, 2024

No description provided.

For this project, you can try to query with the following GraphQL code to get a taste of how it works.

```graphql
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this to include an example balances query

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (address == undefined) {
address = Address.create({
id: accountAddress,
balance: (await erc20.balanceOf(accountAddress)).toBigInt(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you also update the balance of an address if it's known (e.g. refresh this on each new transaction?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see you do this below

});

from.balance = BigInt(from.balance) - value;
to.balance = BigInt(to.balance) + value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safer to do a full await erc20.balanceOf(accountAddress) There might be other functions and activities that change this so best to clean reset.

Use Promise.all([..,..] for performance for these two queries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@jamesbayly jamesbayly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly there, just a few more things

@jamesbayly jamesbayly merged commit c114744 into main Jan 8, 2024
1 of 2 checks passed
@jamesbayly jamesbayly deleted the featuring-memecoin branch January 8, 2024 07:27
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 this pull request may close these issues.

None yet

3 participants