Skip to content

Instantly share code, notes, and snippets.

View dicethedev's full-sized avatar
🚀
Building

Blessing Samuel dicethedev

🚀
Building
View GitHub Profile
@dicethedev
dicethedev / Connect2Phantom.tsx
Created February 7, 2023 14:07 — forked from jmlon/Connect2Phantom.tsx
Example connection to the Phantom wallet for the solana_part1 tutorial
import { FC, useEffect, useState } from "react";
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";
type PhantomEvent = "disconnect" | "connect" | "accountChanged";
interface ConnectOpts {
onlyIfTrusted: boolean;
}
@dicethedev
dicethedev / MyToken.sol
Created January 17, 2023 14:05 — forked from shobhitic/MyToken.sol
ERC20 Permit OpenZeppelin Tutorial - https://www.youtube.com/watch?v=lFKcga4Y6Ys
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.7.3/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC20/extensions/draft-ERC20Permit.sol";
contract MyToken is ERC20, ERC20Permit {
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {}
function mint(address to, uint256 value) external {
import React, { useEffect, useState } from "react";
import { ToastContainer, toast } from "react-toastify";
import { ethers } from "ethers";
import "react-toastify/dist/ReactToastify.css";
import Head from "next/head";
export default function Home() {
/**