Giter VIP home page Giter VIP logo

hardhat-react-boilerplate's People

Contributors

aridder avatar bbenzikry avatar chiranz avatar j-chmielewski avatar ramvi avatar robertosnap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hardhat-react-boilerplate's Issues

'GreeterDeployment' has already been declared

Hi team, thank you for making this template! I cloned, installed, and started the hardhat node per instructions, but 'yarn start' triggers the following build error:

./src/hardhat/SymfoniContext.tsx
SyntaxError: /symfoni/frontend/src/hardhat/SymfoniContext.tsx: Identifier 'GreeterDeployment' has already been declared (8:7)

   6 | import Web3Modal, { IProviderOptions } from "web3modal";
   7 | import GreeterDeployment from "./deployments/localhost/Greeter.json";
>  8 | import GreeterDeployment from "./deployments/localhost/Greeter.json";
     |        ^
   9 | import { Greeter } from "./typechain/Greeter";
  10 | import { Greeter__factory } from "./typechain/factories/Greeter__factory";

Investigating SymfoniContext.tsx shows more instances where a Greeter line of code is repeated 2x:

export const GreeterContext = React.createContext<SymfoniGreeter>(emptyContract);
export const GreeterContext = React.createContext<SymfoniGreeter>(emptyContract);

 const [Greeter, setGreeter] = useState<SymfoniGreeter>(emptyContract);
 const [Greeter, setGreeter] = useState<SymfoniGreeter>(emptyContract);

 const getGreeter = (_provider: providers.Provider, _signer?: Signer) => {
 const getGreeter = (_provider: providers.Provider, _signer?: Signer) => {

Since this is an autogenerated filed, I suspect something is wrong in the build path. What do you think?

Issues using local Mainnet forking?

I had npx hardhat node --watch working fine, and I've also changed providerPriority to ["hardhat", "web3modal"].

I'm trying to build a project that interacts with Uniswap and found that mainnet forking seems to be the way to go about it.

When running npx hardhat node --fork https://eth-mainnet.alchemyapi.io/v2/<api key> it seems to be a breaking change:

Error HH604: Error running JSON-RPC server: Error: ERROR processing /Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/deploy/Greeter.ts:
Error: Invalid signature v value
    at Object.exports.ecrecover (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/node_modules/ethereumjs-util/src/signature.ts:46:11)
    at new ForkTransaction (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkTransaction.ts:32:26)
    at ForkBlockchain._processRemoteBlock (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts:243:9)
    at ForkBlockchain._getBlockByNumber (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts:219:17)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at ForkBlockchain.getLatestBlock (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts:40:19)
    at HardhatNode.getLatestBlockNumber (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:460:20)
    at EthModule._estimateGasAction (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:379:25)
    at HardhatNetworkProvider.request (/Users/ar4s/dev/consensys/blockchain-bootcamp-final-project/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:102:18)

Here is my hardhat config:

const config: HardhatUserConfig = {
  react: {
    providerPriority: ["hardhat", "web3modal"],
  },
  networks: {
    hardhat: {
      chainId: 1337,
      inject: false, // optional. If true, it will EXPOSE your mnemonic in your frontend code. Then it would be available as an "in-page browser wallet" / signer which can sign without confirmation.
      accounts: {
        mnemonic: "test test test test test test test test test test test junk", // test test test test test test test test test test test junk
      } (....)

I've tried toggling the chainId to mainnet and removing it altogether, and google doesn't have any matches for this particular error.

Windows: Error when resolving relative deployments path from HardhatContext

image

packages/hardhat-react/src/TsMorhProject.ts:95

   const relativeDeploymentsPath = path.relative(
      this.hre.config.paths.react,
      this.hre.config.paths.deployments + "/" + currentNetwork
    );

packages/hardhat-react/src/TsMorhProject.ts:179

      deploymentFile: deploymentFile
            ? `${relativeDeploymentsPath}/${deploymentFile}`
            : undefined,

Does not work in Windows.

Need to try and create a fix and run it on windows.

Fix needs to be created in
https://github.com/symfoni/hardhat-plugins

Frontend failed to compile after following all the steps in the documentation

Hi team,

Our team is trying to run this project, but we get the same error all the time after following all the steps required in the Readme:

image

/home/victor/dev/MyProject/frontend/src/hardhat/SymfoniContext.tsx
TypeScript error in /home/victor/dev/MyProject/frontend/src/hardhat/SymfoniContext.tsx(117,17):
Type 'JsonRpcSigner' is not assignable to type 'Signer'.
  The types returned by 'provider.getGasPrice()' are incompatible between these types.
    Type 'Promise<import("/home/victor/dev/MyProject/frontend/node_modules/@ethersproject/contracts/node_modules/@ethersproject/bignumber/lib/bignumber").BigNumber>' is not assignable to type 'Promise<import("/home/victor/dev/MyProject/frontend/node_modules/@ethersproject/bignumber/lib/bignumber").BigNumber>'.  TS2322

    115 |             case "web3modal":
    116 |                 const web3provider = _provider as ethers.providers.Web3Provider
  > 117 |                 return await web3provider.getSigner()
        |                 ^
    118 |             case "hardhat":
    119 |                 return ethers.Wallet.fromMnemonic("test test test test test test test test test test test junk").connect(_provider)
    120 |             default:

Is this boilerplate project actually working? I got it from the documentation: https://hardhat.org/plugins/hardhat-react.html

Starting from scratch and trying to follow the documentation without the boilerplate project was unsuccessful for everyone that tried on our end too. :\

How to deploy dApp on Testnet

Currently, when you spin up the blockchain it is run in watch mode (hh node --watch), which generated sympfoni context files. However, if I want to deploy my application on a testnet (e.g ropsten) the application doesn't generate symfoni files hence, the application fails to run. How can I generate these files on any other blockchain?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.