Skip to content

solved #66

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

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

Conversation

ravicharanj22
Copy link

What was the bug?

The bug was smart contract deployment error. After evaluation the contract failed due to a transaction error highlighted by the client call. The deposit function was failing while sending an asset to a new address without the recepient address opting in to the asset. The address therfore needed to be funded for the transaction to pull through and deposit the asset to the recepients address.

How did you fix the bug?

I performed the run and debug prompt to highlight the errors and pinpoint the areas of interest.
With the help of the documentation from the challenge README file I finally cited the error coming from the ASA Vault smart contract script.
The command "algokit project deploy localnet"responsible for deploying the contract failed as the deposit asset application address was not opted in.
After keen research from the provided Algorand Python Documentation I understood that the optintoasset function was not complete and needed to submit the transaction that would opt in the application address. Funding the application address with the knowledge that: The amount of the asset to be transferred should be a zero amount transferred to the address and allocates that asset in the account's Asset map.
The optintoasset function as well as trhe deposit function needed to be modified in that: the inner transaction that handled zero asset transfer was missing which was handled by hardcoding the transaction. After which asserting that the application address is opted in before transferring the asset.
After simultaneously handling the two errors the contract complied successfully and deployed successfully. TheVault held the "Super Rare Oranges" as expected.
I ran the command "algokit explore" to view the transactions on Dappflow for a sharper verification, of course thanks to the Algorand Foundation for this intuitive approach.
Screenshot 2024-05-06 at 10 13 28 AM

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

🎉 Congrats on solving the 3rd 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/h82968w2n76k9t6tz2ekm7zg790t6y7xwmqj0esqcbgaqd8641merqczya8mcmm238p1n1j6vjzwc23a3ztat3jew07z4ahrs56z41r

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.

3 participants