web-contract
v0.0.7
Published
solidity front end contract
Downloads
5
Maintainers
Readme
web-contract
A package to deploy your react app as a smart contract for use with a web3 browser.
Using Tasks
This project includes several Hardhat tasks to help you deploy, manage, and interact with your smart contract. Here's how to use them:
Build Folder
To build your react app you'll need to open your project in a new terminal window and run:
npm run build
This will create a build folder with the react app's code, which you will need to copy into the build folder of this project.
Deploy Contract
To deploy the WebContract or use an existing deployment:
npx hardhat deploy-contract [action] --network <network-name>
[action]
: Optional. Use 'redeploy' to force redeployment.--network
: Optional. The network to deploy to, if not specified, the hardhat VM network will be used.
Note: After deployment, the contract address is automatically added to the package.json
file under the "contract"
key.
Upload to IPFS
To upload specific files or the entire build folder to IPFS:
npx hardhat upload-ipfs-assets [files...] --network <network-name>
[files...]
: Optional. Specific files to upload. If not specified, the entire build folder will be processed.--network
: Optional. The network to upload to, if not specified, the hardhat VM network will be used.
Write to Contract
To write specific files or the entire build folder to the smart contract:
npx hardhat write-to-contract [filePath] --network <network-name>
[filePath]
: Optional. Relative path of the file to upload (from build folder). If not specified, the entire build folder will be processed.--network
: Optional. The network to write to, if not specified, the hardhat VM network will be used.
Read from Contract
To read files from the smart contract:
npx hardhat read-from-contract <fileName> --network <network-name>
<fileName>
: Required. The name of the file to read.--network
: Optional. The network to read from, if not specified, the hardhat VM network will be used.
Disclaimer
These instructions were generated by the Claude-3.5-sonnet model using Cursor AI. Please verify and adjust as needed for your specific project setup.