Skip to content

cloudflare/cfweb3

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
img
 
 
 
 
 
 
 
 
 
 

CFWeb3

CFWeb3 is a Web3 demo application. It uses Hardhat and Solidity to create an Ethereum smart contract. This code is a proof-of-concept showing how to build Web3 applications with Cloudflare, and should not be used as a production example.

The contract offers 2048 tokens which can be minted via the frontend Svelte application. The entire app runs on the Rinkeby test network.

Demo

A live version of this demo app can be found at cf-web3.pages.dev.

Building locally

  1. Clone the repo with git clone git@github.com:cloudflare/cfweb3.git
  2. npm install in contract and frontend with:
cd cfweb3/contract
npm install
cd ../frontend
npm install
  1. Install Metamask, switch to the testnet and add funds (instructions below)
  2. Click on Metamask and then on the hamburger icon in the top right
  3. Click on "Account details"
  4. Click on "Export Private Key"
  5. Enter Metamask password
  6. Copy your private key
  7. In one terminal window, move into the contract directory and run:
dapk="YOUR_PRIVATE_KEY" npx hardhat node
  1. In a different terminal window, move into the frontend directory and run:
npm run dev

Adding funds to your Metamask test account

  1. Install Metamask
  2. Switch Metamask to the Rinkeby test network

Metamask switch to testnet

  1. Copy your Rinkeby account wallet address.

  2. Go to the Rinkeby faucet

  3. Post a Tweet or a Facebook status with your Rinkeby wallet address.

  4. Enter the URL of your Tweet or Facebook post on the faucet website.

  5. Claim the amount you want.

  6. Delete the social media post (optional).

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published