简体   繁体   中英

Creating and deploying a smart contract through a front end react form

I want to know if it's possible to create and deploy a smart contract using a front end form with React and I don't seem to be able to find a clear answer for this question online.

In other words, instead of hard coding their own solidity smart contract, a user would simply have to fill a form which (on submit) will send the filled data to the back end where we'll use them to complete the smart contract code and then deploy it with truffle/hardhat. I looked through the docs and similar questions but most of them are talking about the case where you have an already deployed smart contract and how can it interact with your React app (which isn't what I'm looking for in this case).

Any help is much appreciated

I would take a look at OpenZeppelin's contract wizard https://docs.openzeppelin.com/contracts/4.x/wizard . This essentially does exactly what you are trying to implement, so I would start by looking at this. To accomplish this, you would need a way to create/edit a local Solidity file somehow based on what the user chooses. From there it would be just as easy as clicking a button to compile/deploy the contract onto a specific network.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM