Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Hardhar Deploy solidity smart contract using onClick event in React

I would like to deploy my contract in frontend after a user click on a button. In hardhat documentation, I would have to normally run npx hardhat run scripts/deploy.js in my terminal to deploy. Is it possible to deploy in the frontend?

The code below is something I would like to do.

const hre = require("hardhat")   // this will cause error 
const deployClick = async () => {
      setIsNoClicked(true);
      const ticketContract = await hre.ethers.getContractFactory("Greeter");
      const ticket = await ticketContract.deploy("Hello, Hardhat!");
      await ticket.deployed();
      console.log("Ticket Contract deployed to:", ticket.address);
    }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!