Skip to content

Conversation

@nrstone
Copy link

@nrstone nrstone commented Apr 11, 2024

Algorand Coding Challenge Submission

What was the bug?

The original code did not correctly initialize the local and global state variables and did not instantiate them with initial values or types in the constructor

The bug was fixed by adding an init method to the Counter class, where the local state (count) and global state (counters) variables are initialized with their respective types and initial values.
For count, it was initialized as a LocalState with UInt64 indicating that it expects unsigned 64-bit integers keyed by transaction sender addresses.

For counters, it was initialized as a GlobalState with an initial value of UInt64(0), setting up a global counter starting at 0.

Console Screenshot:

Screenshot 2024-04-11 at 4 01 54 PM

@iskysun96 iskysun96 added the Approved ✅ Successfully completed the challenge! label Apr 12, 2024
@iskysun96
Copy link
Contributor

🎉 Congrats on solving the 2nd Algorand Python Coding Challenge!

I have labeled your PR approved, so you can now claim your certificate.

You can claim your certificate of completion NFT here:
https://goplausible.xyz/claim/pz11yepgf0h0n3xr858ptvc2bp6vn4bpae5scrh16a7jjpm1d85402qfxh6pmf19jes5ny9mbfmgxdq64yhgy20zc839278nc0k2g2r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved ✅ Successfully completed the challenge!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants