Skip to content

Commit 7652c68

Browse files
committed
Add supported chain alert, removed unneeded chains
1 parent 60b3e59 commit 7652c68

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# twitt3r.xyz
22
This repo contains the source code for [Twitt3r](https://twitt3r.xyz), a decentralized Twitter clone built on the [Ethereum blockchain](https://ethereum.org/en/). The project utilizes a custom smart contract for message storage, and [ENS lookups](https://ens.domains/) for profile information. It is deployed to the [Goerli](https://goerli.etherscan.io/address/0x3493B7ABE5e6E142D632e6596bc550A73c87Ee79) and [Ropsten](https://ropsten.etherscan.io/address/0x3493B7ABE5e6E142D632e6596bc550A73c87Ee79) testnets.
33

4+
**Want to learn more? Read all the details in [this blog post!](https://maxpetretta.com/blog/twitt3r)**
5+
46
## Demo
5-
<img src="./demo.gif" alt="A quick 60 second demo of twitt3r.xyz" title="Twitt3r demo gif">
7+
[![A quick 60 second demo of twitt3r.xyz](./demo.gif)](https://twitt3r.xyz)
68

79
## Tech Stack
810
Built with the following technologies:

hardhat/.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
RINKEBY_INFURA_URL=https://rinkeby.infura.io/v3/<PROJECT_ID>
1+
GOERLI_INFURA_URL=https://goerli.infura.io/v3/<PROJECT_ID>
22
ROPSTEN_INFURA_URL=https://ropsten.infura.io/v3/<PROJECT_ID>
3+
RINKEBY_INFURA_URL=https://rinkeby.infura.io/v3/<PROJECT_ID>
34
KOVAN_INFURA_URL=https://kovan.infura.io/v3/<PROJECT_ID>
4-
GOERLI_INFURA_URL=https://goerli.infura.io/v3/<PROJECT_ID>
55
OP_KOVAN_INFURA_URL=https://optimism-kovan.infura.io/v3/<PROJECT_ID>
66
OPTIMISM_INFURA_URL=https://optimism-mainnet.infura.io/v3/<PROJECT_ID>
77
PRIVATE_KEY=<PRIVATE_KEY>

hardhat/hardhat.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ module.exports = {
1414
defaultNetwork: "localhost",
1515
networks: {
1616
localhost: {},
17-
rinkeby: {
18-
url: process.env.RINKEBY_INFURA_URL,
17+
goerli: {
18+
url: process.env.GOERLI_INFURA_URL,
1919
accounts: [process.env.PRIVATE_KEY],
2020
},
2121
ropsten: {
2222
url: process.env.ROPSTEN_INFURA_URL,
2323
accounts: [process.env.PRIVATE_KEY],
2424
},
25-
kovan: {
26-
url: process.env.KOVAN_INFURA_URL,
25+
rinkeby: {
26+
url: process.env.RINKEBY_INFURA_URL,
2727
accounts: [process.env.PRIVATE_KEY],
2828
},
29-
goerli: {
30-
url: process.env.GOERLI_INFURA_URL,
29+
kovan: {
30+
url: process.env.KOVAN_INFURA_URL,
3131
accounts: [process.env.PRIVATE_KEY],
3232
},
3333
op_kovan: {

react/components/Layout.jsx

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Head from "next/head"
22
import { useRouter } from "next/router"
33
import { useState } from "react"
4-
import { Toaster } from "react-hot-toast"
4+
import toast, { Toaster } from "react-hot-toast"
55
import { useAccount, useContractRead } from "wagmi"
66
import { contractABI, contractAddress } from "../lib/contract.js"
77
import Nav from "./Nav"
@@ -25,10 +25,22 @@ export default function Layout(props) {
2525
const [isOwner, setIsOwner] = useState(false)
2626
useAccount({
2727
onSuccess(data) {
28-
if (data) {
28+
if (data && !address) {
2929
setAddress(data.address)
3030
console.debug("Found authorized account: ", data.address)
3131

32+
// Alert user to which networks are available
33+
toast("Twitt3r only supports Goerli & Ropsten testnets!", {
34+
duration: 8000,
35+
position: "top-center",
36+
style: {
37+
color: "#FFFFFF",
38+
backgroundColor: "#DC2626",
39+
minWidth: "440px",
40+
},
41+
icon: "⚠️",
42+
})
43+
3244
// Check if this is the owner's wallet
3345
if (
3446
ownerData &&

react/pages/_app.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import "../styles/globals.css"
1717
const { chains, provider } = configureChains(
1818
[
1919
chain.hardhat,
20-
chain.rinkeby,
21-
chain.ropsten,
22-
chain.kovan,
2320
chain.goerli,
24-
chain.optimismKovan,
21+
chain.ropsten,
22+
// chain.rinkeby,
23+
// chain.kovan,
24+
// chain.optimismKovan,
25+
// chain.optimism,
2526
], // Hardhat must come first due to provider issue, see: https://github.com/tmm/wagmi/discussions/425
2627
[
2728
infuraProvider({ infuraId: process.env.REACT_APP_INFURA_ID }),

react/styles/globals.css

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
@tailwind utilities;
44

55
@layer base {
6-
html {
7-
/* @apply bg-gray-900; */
8-
}
96
a {
107
@apply text-twitter-blue hover:underline;
118
}

0 commit comments

Comments
 (0)