Welcome to the most exciting DeFi adventure! 🎉 Get ready to dive into the world of stablecoins, yield farming, and automated market making!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dotenv from "dotenv"; | |
dotenv.config(); | |
import { ethers, Wallet } from "ethers"; | |
import { config } from "hardhat"; | |
import password from "@inquirer/password"; | |
import { input, confirm, select } from "@inquirer/prompts"; | |
interface AccountInfo { | |
address: string; | |
wallet: Wallet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.27; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; | |
import "./MentorNFT.sol"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.27; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/security/Pausable.sol"; | |
import "@openzeppelin/contracts/access/AccessControl.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
// --- Custom Errors --- | |
error MentorNFT_ZeroAddressOwner(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.27; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/security/Pausable.sol"; | |
import "@openzeppelin/contracts/access/AccessControl.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
// --- Custom Errors --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.27; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; | |
import "./MentorNFT.sol"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.28; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import {FunctionsClient} from "./@chainlink/contracts/src/v0.8/functions/dev/1_0_0/FunctionsClient.sol"; | |
import {ConfirmedOwner} from "./@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol"; | |
import {FunctionsRequest} from "./@chainlink/contracts/src/v0.8/functions/dev/1_0_0/libraries/FunctionsRequest.sol"; | |
contract FunctionsConsumerExample is FunctionsClient, ConfirmedOwner, ERC721 { | |
using FunctionsRequest for FunctionsRequest.Request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This example show how to check if an account is enlisted in the mission | |
const account = args[0].toLowerCase() // make sure the account is in lowercase | |
const query_url = args[1] //https://api.studio.thegraph.com/query/37762/mymission/version/latest | |
// Uncomment to use Graph API Key (for published missions) | |
//const graphKey = secrets.graphKey | |
const graphRequest = Functions.makeHttpRequest({ | |
url: `${query_url}`, | |
method: "POST", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { useState } from "react"; | |
import type { NextPage } from "next"; | |
import { formatEther, parseEther } from "viem"; | |
import { useAccount } from "wagmi"; | |
import { Address, AddressInput, EtherInput } from "~~/components/scaffold-eth"; | |
import { useScaffoldReadContract, useScaffoldWriteContract } from "~~/hooks/scaffold-eth"; | |
const Home: NextPage = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.0 <0.9.0; | |
import "hardhat/console.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
/** | |
* A smart contract for a workshop during EthCC | |
* @author Kevin Jones | |
*/ |
NewerOlder