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

Fix type mismatches in PersonalVault smart contract for Python Challenge 1 #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

algotables
Copy link

@algotables algotables commented May 10, 2024

Algorand Coding Challenge Submission

What was the bug?

The bug occurred in the PersonalVault smart contract's deposit method:

  1. The ptxn.receiver was incorrectly compared to Global.current_application_id instead of Global.current_application_address, leading to a type mismatch.
  2. The op.app_opted_in function was called with an incorrect type for the second argument, resulting in an error due to an incompatible type comparison.

How did you fix the bug?

  1. Updated the comparison in the deposit method to use Global.current_application_address instead of Global.current_application_id, ensuring that deposits are correctly sent to the smart contract's account.
  2. Corrected the second argument passed to op.app_opted_in by using Global.current_application_id, aligning it with the expected types.

Console Screenshot:

python-challenge-1-jeff-stein-5-9-24

- Updated `ptxn.receiver` comparison to use `Global.current_application_address` instead of `Global.current_application_id` to fix type mismatch.

- Corrected `op.app_opted_in` function call to pass `Global.current_application_id` instead of `Global.current_application_address`.
@iskysun96 iskysun96 added the Approved ✅ Successfully completed the challenge! label May 16, 2024
@iskysun96
Copy link
Contributor

🎉 Congrats on solving the 1st 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/5rc2q57822ka1h0pf4eqv6yx1nxwwvvf5m72vte7gdf6sr0wxd4ccdsp3qzmtas72jxdnrjv9ewf6rwee0aerm1whzt509dv2rh5w18

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