Giter Site home page Giter Site logo

deletelater's Issues

Corrected code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {LessonNine} from "9-lesson.sol";


contract Solution is IERC721Receiver {
    // Address of the ERC721 contract that holds the NFTs.
    address public contractAddress = 0x33e1fD270599188BB1489a169dF1f0be08b83509;

    uint256 public correctAnswer;
    LessonNine public lessonNine;

    // The constructor sets the contractAddress and correctAnswer based on some initialization logic.
    constructor() {
       lessonNine = LessonNine(contractAddress);
    }


    // Function to call the solveChallenge function on the ChallengeInterface contract.
    function callSolveChallenge() external {
        correctAnswer = uint256(keccak256(abi.encodePacked(address(this), block.prevrandao, block.timestamp))) % 100000;
        lessonNine.solveChallenge(correctAnswer, "sharonplima");
    }


    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
        public override returns (bytes4) {
        return this.onERC721Received.selector;
    }

    function sendNft(address _yourAddress)public{
        lessonNine.transferOwnership(_yourAddress);
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.