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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.