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

[examples]: GRC20 underflow/overflow checking #2873

Open
MalekLahbib opened this issue Sep 30, 2024 · 5 comments
Open

[examples]: GRC20 underflow/overflow checking #2873

MalekLahbib opened this issue Sep 30, 2024 · 5 comments

Comments

@MalekLahbib
Copy link
Contributor

MalekLahbib commented Sep 30, 2024

Description

@moul, I was checking the grc20 package, and in banker.gno file you put // TODO: check for overflow in the Mint and Burn functions.
I added the check in Mint function and added a test file.

Screenshot 2024-09-30 at 17 27 20 Screenshot 2024-09-30 at 17 26 43

but I don't see why (or how) to check for overflow in Burn function, as the check in Mint function is enough to protect from overflow.

Screenshot 2024-09-30 at 17 06 40
@leohhhn
Copy link
Contributor

leohhhn commented Sep 30, 2024

Can you please link the specific files you're talking about?

@MalekLahbib
Copy link
Contributor Author

Can you please link the specific files you're talking about?

I updated my comment.

@leohhhn
Copy link
Contributor

leohhhn commented Sep 30, 2024

Thanks.

I think the idea here was to check for underflow in the case of burn.

@MalekLahbib
Copy link
Contributor Author

I created this PR2874.

@leohhhn
Copy link
Contributor

leohhhn commented Sep 30, 2024

Cool, I'll take a look. Thanks.

In the future, please try to make your PRs & issues a bit more descriptive, so that the person reading it has the context needed to understand. This also applies to issue/PR names :)

@leohhhn leohhhn changed the title about checking for overflow in grc20 banker pkg [examples]: GRC20 underflow/overflow checking Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

2 participants