@@ -10,6 +10,7 @@ import { useUserAddress } from "eth-hooks";
10
10
import { useQuery , gql } from "@apollo/client" ;
11
11
import { formatEther , parseEther } from "@ethersproject/units" ;
12
12
import { useThemeSwitcher } from "react-css-theme-switcher" ;
13
+ import { ethers } from "ethers" ;
13
14
import {
14
15
useExchangePrice ,
15
16
useGasPrice ,
@@ -31,18 +32,18 @@ import PostView from "./views/PostView";
31
32
32
33
import GraphqlSign from "./GraphqlSign" ;
33
34
34
- import { ethers } from 'ethers' ;
35
- import DecentralisedDonuts from "./contracts/DecentralisedDonuts.abi.js" ;
36
- import FictionalFinance from "./contracts/FictionalFinance.abi.js" ;
37
- import InterestingIguanas from "./contracts/InterestingIguanas.abi.js"
35
+ import DisplayUser from "./components/User/DisplayUser" ;
36
+
37
+ // import DecentralisedDonuts from "./contracts/DecentralisedDonuts.abi.js";
38
+ // import FictionalFinance from "./contracts/FictionalFinance.abi.js";
39
+ // import InterestingIguanas from "./contracts/InterestingIguanas.abi.js"
38
40
39
41
const axios = require ( "axios" ) ;
40
42
41
43
const donutAddress = "0x6e6598Bd833c3ABf05dBb64c0FDfEd11e6881E26" ;
42
44
const fictionalAddress = "0xD5BF303973Fef7B7821378E8aFE890BEd8b102f3" ;
43
45
const iguanaAddress = "0x6845556EAbdB4a535B98746CB4A2ee4BF79C508e" ;
44
46
45
-
46
47
/*
47
48
Welcome to 🏗 scaffold-eth !
48
49
@@ -252,48 +253,44 @@ function App(props) {
252
253
</ div >
253
254
) ;
254
255
}
255
- async function mintDonut ( ) {
256
-
257
- const provider = new ethers . providers . Web3Provider ( window . ethereum ) ;
258
- const signer = provider . getSigner ( )
259
- const contract = new ethers . Contract ( donutAddress , DecentralisedDonuts , signer )
260
- try {
261
- const mint = await contract . mintToken ( ) ;
262
- await mint . wait ( ) ;
263
- console . log ( '1 Decentralised Donut minted' )
264
- } catch ( error ) {
265
- console . error ( 'Transaction Failed. Address already opted in?' )
266
- }
267
- }
268
-
269
- async function mintFictional ( ) {
270
-
271
- const provider = new ethers . providers . Web3Provider ( window . ethereum ) ;
272
- const signer = provider . getSigner ( )
273
- const contract = new ethers . Contract ( fictionalAddress , FictionalFinance , signer )
274
- try {
275
- const mint = await contract . mintToken ( ) ;
276
- await mint . wait ( ) ;
277
- console . log ( '1 Fictional Finance Token minted' )
278
- } catch ( error ) {
279
- console . error ( 'Transaction Failed. Address already opted in?' )
280
- }
281
- }
282
-
283
- async function mintIguana ( ) {
284
-
285
- const provider = new ethers . providers . Web3Provider ( window . ethereum ) ;
286
- const signer = provider . getSigner ( )
287
- const contract = new ethers . Contract ( iguanaAddress , InterestingIguanas , signer )
288
- try {
289
- const mint = await contract . mintToken ( ) ;
290
- await mint . wait ( ) ;
291
- console . log ( '1 Interesting Iguana minted' )
292
- } catch ( error ) {
293
- console . error ( 'Transaction Failed. Address already opted in?' )
294
- }
295
- }
296
-
256
+ // async function mintDonut() {
257
+ // const provider = new ethers.providers.Web3Provider(window.ethereum);
258
+ // const signer = provider.getSigner();
259
+ // const contract = new ethers.Contract(donutAddress, DecentralisedDonuts, signer);
260
+ // try {
261
+ // const mint = await contract.mintToken();
262
+ // await mint.wait();
263
+ // console.log("1 Decentralised Donut minted");
264
+ // } catch (error) {
265
+ // console.error("Transaction Failed. Address already opted in?");
266
+ // }
267
+ // }
268
+
269
+ // async function mintFictional() {
270
+ // const provider = new ethers.providers.Web3Provider(window.ethereum);
271
+ // const signer = provider.getSigner();
272
+ // const contract = new ethers.Contract(fictionalAddress, FictionalFinance, signer);
273
+ // try {
274
+ // const mint = await contract.mintToken();
275
+ // await mint.wait();
276
+ // console.log("1 Fictional Finance Token minted");
277
+ // } catch (error) {
278
+ // console.error("Transaction Failed. Address already opted in?");
279
+ // }
280
+ // }
281
+
282
+ // async function mintIguana() {
283
+ // const provider = new ethers.providers.Web3Provider(window.ethereum);
284
+ // const signer = provider.getSigner();
285
+ // const contract = new ethers.Contract(iguanaAddress, InterestingIguanas, signer);
286
+ // try {
287
+ // const mint = await contract.mintToken();
288
+ // await mint.wait();
289
+ // console.log("1 Interesting Iguana minted");
290
+ // } catch (error) {
291
+ // console.error("Transaction Failed. Address already opted in?");
292
+ // }
293
+ // }
297
294
298
295
const isSigner = injectedProvider && injectedProvider . getSigner && injectedProvider . getSigner ( ) . _isSigner ;
299
296
@@ -307,7 +304,7 @@ function App(props) {
307
304
let extraLink = "" ;
308
305
if ( possibleTxId . indexOf ( "0x" ) == 0 ) {
309
306
extraLink = (
310
- < a href = { blockExplorer + "tx/" + possibleTxId } target = "_blank" >
307
+ < a href = { blockExplorer + "tx/" + possibleTxId } target = "_blank" rel = "noreferrer" >
311
308
view transaction on etherscan
312
309
</ a >
313
310
) ;
@@ -460,7 +457,7 @@ function App(props) {
460
457
461
458
{ display }
462
459
< GraphqlSign injectedProvider = { injectedProvider } userProvider = { userProvider } address = { address } />
463
-
460
+ < DisplayUser />
464
461
< BrowserRouter >
465
462
< Menu style = { { textAlign : "center" } } selectedKeys = { [ route ] } mode = "horizontal" >
466
463
< Menu . Item key = "/" >
@@ -489,8 +486,7 @@ function App(props) {
489
486
setRoute ( "/faucet" ) ;
490
487
} }
491
488
to = "/faucet"
492
- >
493
- </ Link >
489
+ />
494
490
</ Menu . Item >
495
491
</ Menu >
496
492
@@ -505,9 +501,9 @@ function App(props) {
505
501
506
502
< Route exact path = "/faucet" >
507
503
< span > MINT</ span >
508
- < button onClick = { mintDonut } > Mint A Decentralised Donut</ button >
504
+ { /* <button onClick={mintDonut}>Mint A Decentralised Donut</button>
509
505
<button onClick={mintFictional}>Mint A Fictional Finance Token</button>
510
- < button onClick = { mintIguana } > Mint An Interesting Iguana</ button >
506
+ <button onClick={mintIguana}>Mint An Interesting Iguana</button> */ }
511
507
</ Route >
512
508
513
509
< Route path = "/" >
0 commit comments