react-solidity template
This template sets up a combination of Solidity smart contracts and a React front-end app that interacts with these
smart contracts.
This template includes
Writing smart contracts
Currently, only Remix environment is supported.
- Run
pnpm remixd
to start remixd environment. - Go to https://remix.polkadot.io and activate REMIXD plugin.
- Start hacking! Changes performed in Remix will be synced to local file system.
- After deploying and pinning a smart contract, it'll be saved on your file system, run
pnpm contracts:build
to
export contract data.
Interacting with smart contracts from frontend app
- Run
pnpm frontend:dev
to start vite
environment - You can import all exported contracts using
import { contracts } from "contracts"
- You can call your contracts like this:
import { Contract, formatEther } from "ethers";
import { contracts, ContractData } from "contracts"
const contractData: ContractData = contracts["1b5b93a223026219f4f75e5b90c20970ab976451"];
const contract = new Contract(contractData.address, contractData.abi, signer);
const transactionResponse = await contract.retrieve();
More info at: