import React from 'react'
import ReactDOM from 'react-dom'
import {
DAppProvider,
useEthers,
useTransactions,
useContractFunction,
Config,
Goerli,
Kovan,
Rinkeby,
Ropsten,
} from '@usedapp/core'
import { getDefaultProvider, utils } from 'ethers'
import { Contract } from '@ethersproject/contracts'
import { WethAbi, WETH_ADDRESSES } from './constants/Weth'
import { MetamaskConnect } from './components/MetamaskConnect'
const config: Config = {
readOnlyChainId: Goerli.chainId,
readOnlyUrls: {
[Goerli.chainId]: getDefaultProvider('goerli'),
[Kovan.chainId]: getDefaultProvider('kovan'),
[Rinkeby.chainId]: getDefaultProvider('rinkeby'),
[Ropsten.chainId]: getDefaultProvider('ropsten'),
},
}
ReactDOM.render(
Status: {status}
Transactions
{transactions.length !== 0 && (| Name | Block hash | Date | {transactions.map((transaction) => { return (
|---|---|---|
| {transaction.transactionName} | {transaction.receipt?.blockHash ?? 'Pending...'} | {new Date(transaction.submittedAt).toDateString()} |
Please use either Goerli, Kovan, Rinkeby or Ropsten testnet.
} return