Check out a live deployment here.
git clone https://github.com/42eggs/nft-game
cd nft-game
npm install
npm run dev
cd backend
npm install
-
Replace/Add character values as you wish in
backend/charValues.json
. I've used Game of Thrones characters 😅 -
Rename
.env-example
to.env
in/backend
and fill it up the required values. -
Deploy to any network by
-
npx hardhat run scripts/deploy.js --network {networkName}
This will create the deployed address inside
addresses/NFTGame.json
along with the network ID like"80001":"0xA154541E74523fE9b82E47501B36908E3237c52a"
This can be later used by React.
-
React will automatically pull the address and contract ABI from
backend/addresses/NFTGame.json
andbackend/artifacts/contracts/NFTGame.sol/NFTGame.json
respectively. -
If you make any changes to the smart contract, just make sure to re-deploy and update the chainID in
src/utils.js