1.0.3 ā€¢ Published 1 year ago

create-fvm-dapp v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

A full-stack starter template with React & Hardhat to develop, deploy, and test Solidity smart contracts on the FEVM network. The starter kit also includes pre-installed web3.storage, tailwindcss, web3.js, etc. packages.

šŸ“ŗ Quickstart

šŸ› ļø Installation guide

āŒ›ļø create-fvm-dapp command

Open up your terminal (or command prompt) and type the following command:

npx create-fvm-dapp <your-dapp-name>

# cd into the directory
cd <your-dapp-name>

āš ļø If you encounter any errors during package installation, please ensure that your node.js and npm versions are up-to-date.

šŸ”‘ Private key

Ensure you create a .env file in the root directory. Then paste your Metamask private key in .env with the variable name PRIVATE_KEY as follows:

PRIVATE_KEY=1234

āš™ļø Compile

Now, you can write your contracts in ./contracts/ directory, replace Greeter.sol with <your-contracts>.sol file. To write tests, go to ./test directory and create <your-contracts>.test.js.

npx hardhat compile

# for testing the smart contracts
npx hardhat test

After successful compilation, the artifacts directory will be created in ./src/artifacts with a JSON /contracts/<your-contracts>.sol/<your-contracts>.json containing ABI and Bytecode of your compiled smart contracts.

Please make the changes while Importing the JSON in ./src/app.js.

ā›“ļø Deploy

Before deploying the smart contracts, please make sure you have a hyperspace testnet in your Metamask wallet with sufficient funds, follow this quickstart guide if you do not have one.

Also, make changes in ./scripts/deploy.js (replace the greeter contract name with <your-contract-name>).

For deploying the smart contracts to FEVM network, type the following command:

npx hardhat run --network hyperspace scripts/deploy.js

# mainnet: npx hardhat run --network filecoin_mainnet scripts/deploy.js

Copy-paste the deployed contract address here

šŸ“œ Contract deployed to: 0x...

šŸ’» React client

start react app

npm start
# Starting the development server...

Please read the hardhat documentation and FVM documentation for more details.

āš–ļø License

create-fvm-dapp is licensed under the MIT License.