Lesson9ChallengeSolved. Tricky outcome. Caution - some logic spoilers. #558
Closed
mibiot
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Few days I have been trying to solve the challenge for Lesson9. I started this course with 0 skills in coding, so it took a while to start to read and even write some code. So the project to solve Lesson9 quest was the first contract I created by myself from scratch. Here I would like to share the results since the outcome seems a bit tricky. I will try not to spoil the quest but to explain the outcome I have to share the logic, so those who still want to think and solve the quest by themselves please do not follow further.
I made a contract(lets call it C for further explanations) that calculates the right answer and calls the solveChallenge function from the Lesson9 contract. C also has 2 functions - onERC721Received and transferFrom (in the first run I used safeTransferFrom), thus the logic was to get an NFT for solving the quest and then transfer it to my wallet. Then I made a script for deploying C, ran it on --fork-url, all worked, and so I decided to run it on Sepolia.
The script ran successfully, and here what happened next: C got and NFT, successfully transferred the NFT to my wallet, but C still had kept the ownership for the NFT (accordingly to FCN contract (0x76B50696B8EFFCA6Ee6Da7F6471110F334536321))The NFT is in my wallet but my wallet address has no rights for the NFT according to the FCN contract's database. Ok, so this morning I decided to change the function that transfers the NFT from C (to be precise a new version of C that will be created with the Script) to my wallet after getting a minted NFT from FCN. I asked AI if there was a function that transfer the ownership for an NFT when transferring it. AI said there was one - transferFrom, so I decided to change safeTransferFrom to transferFrom, ran the Script again and the same things happened except only one detail - the minted token was transferred to my wallet with #0 tokenId instead of 1300 as it had originally.
So here are few questions I would like to discuss to understand the subject better:
The numbers of the NFTs I am talking about are 1298 and 1300. You can check all transaction in Etherscan.
Thanks for sharing your ideas.
Beta Was this translation helpful? Give feedback.
All reactions