Skip to content

A package to deploy your react app as a smart contract for use with a web3 browser.

License

Notifications You must be signed in to change notification settings

TechnicallyWeb3/web-contract

Repository files navigation

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 large and unsupported assets to IPFS:

npx hardhat upload-ipfs-assets [action] --network <network-name>
  • [action]: Optional. Use 'force' to force reupload.
  • --network: Optional. The network to upload to, if not specified, the hardhat VM network will be used.

Write to Contract

To write files to the smart contract:

npx hardhat write-to-contract [action] --network <network-name>
  • [action]: Optional. Use 'force' to force rewrite.
  • --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.

About

A package to deploy your react app as a smart contract for use with a web3 browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published