Skip to content

Instantly share code, notes, and snippets.

import { useCallback, useEffect, useRef } from 'react'
import { ethers } from "ethers";
import abi from "./api/WavePortal.json";
import React, { useEffect, useState } from "react";
import { Flex, Heading, Text } from '@chakra-ui/react'
import { ConnectButton } from '@rainbow-me/rainbowkit'
import { useAccount, useContract, useSigner } from "wagmi";
import { Input } from '@chakra-ui/react'
import { Image } from '@chakra-ui/react'
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
abstract contract ERC721Lendable is ERC721 {
struct UserInfo {
address user; // address of user role
uint64 expires; // unix timestamp, user expires
}
mapping(uint256 => UserInfo) internal _users;
import type { NextApiRequest, NextApiResponse } from 'next';
import Parser from 'rss-parser';
import { HashnodePost } from '../../utils/types';
import { RSS_FEED_URL } from '../../utils/utils';
import { prisma } from '../../lib/prisma';
import { Post } from '@prisma/client';
export default async function handler(
_req: NextApiRequest,
res: NextApiResponse
{
"image": "https://gateway.pinata.cloud/ipfs/QmPrVVinxdtiLq1BymDRTt9HkfcvCUqeM1WboYydDrqGJq",
"name": "Simple NFT",
"description": "there is no description lmao",
}

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{"jsonrpc":"2.0","id":52,"error":{"code":3,"message":"execution reverted: AccessControl: account 0x8d524d9473988731ddda2148f307b450ed022749 is missing role 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6","data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000094416363657373436f6e74726f6c3a206163636f756e7420307838643532346439343733393838373331646464613231343866333037623435306564303232373439206973206d697373696e6720726f6c6520307839663264663066656432633737363438646535383630613463633530386364303831386338356238623861316162346365656566386439383163383935366136000000000000000000000000"}}","error":{"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000

const provider = new ethers.providers.JsonRpcProvider(
'https://rpc.ankr.com/polygon_mumbai',
80001
);
const signer = new ethers.Wallet(process.env.PRIVATE_KEY as string, provider);
const sdk = new ThirdwebSDK(signer, {
gasless: {
openzeppelin: {
relayerUrl: process.env.RELAYER_WEBHOOK_URL as string,
},
const provider = new ethers.providers.JsonRpcProvider(
'https://rpc.ankr.com/polygon_mumbai',
80001
);
const sdk = new ThirdwebSDK(provider, {
gasless: {
openzeppelin: {
relayerUrl:
'<my_webhook',
},
@Dhaiwat10
Dhaiwat10 / about.md
Created June 11, 2022 08:52
EthToronto - About me

i'm dhaiwat - a 21 yo builder from developer dao & devrel @ ankr. cami from the graph might've vouched for me. i was a full-stack web2 engg for 4 yrs before I got into web3 9 months ago through gitcoin dao and got greenpilled. ☀️🌿 haven't looked back since. public goods are good.

since then i've been building lots of OSS tools like web3-ui (https://github.com/developer-dao/web3-ui) and creating educational content around tools like wagmi (https://www.youtube.com/watch?v=3QgqoHggwhg&amp;feature=youtu.be). i'll let my github do the rest of the talking 😉: https://github.com/dhaiwat10

@Dhaiwat10
Dhaiwat10 / proposal.md
Created June 11, 2022 08:51
EthToronto talk proposal

in my talk i want to talk about the decentralization aspect of web3 frontends. our smart contracts are decentralized, permanent, censorship resistant and forkable - but what about our frontends? what about the user interfaces that most people actually use to interact with the contracts?

right now, most 'web3' frontends are just a next.js app running on a centralized vercel (read AWS) server somewhere (yes most of them use a server). not so web3.

so, an outline:

  • the current state of most 'web3' frontends, what's wrong with them.
  • why running everything on the client-side is important for a dApp (no servers! i'll talk about why trusting servers for frontends is a really fucking terrible idea and the fact that you don't even need one for a dApp)
  • how you can deploy an actually decentralized and permanent web3 frontend (i'll deploy a react app to arweave live)
  • making our frontends easily forkable and self-hostable (in the spirit of open source software and compasiblity)