0

I am new to ethereum I building a course page where you would get an NFT if you complete the course. Any idea on how to implement it.

1
  • Is the course about learning how to mint NFTs?
    – 0xSanson
    Jun 3 at 14:33

1 Answer 1

0

you need to have mapping to get track of whether an address is completed the course or not eg: mapping(address => bool) public isCompleted you can updtae this mapping if specefic address completed the course.

you also need a function called getReward then in the function you should check the mapping, you can implement it like this :

function getreward() public{
    bool courseCompleted = isCompleted[msg.sender];
    require(courseCompleted,"not completed the course");

    // if require get passed then the code to transfer or mint the NFT goes here
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.