Skip to content

bobeu/connect-and-interact-with-celo-using-web3react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect and interact with Celo using web3React

  • Backend
    • Stacks
      • Foundry
      • Solidity

For full understanding of the backend, follow this tutorial

  • Frontend
    • Stacks
      • React
      • NextJs
      • MaterialUi
      • etherJs
      • We3Js

How to run

Note : Install Metamask browser extension.

git clone https://github.com/bobeu/connect-and-interact-with-celo-using-web3react.git/
cd connect-and-interact-with-celo-using-web3react/frontend
yarn install
yarn run dev

Smart contracts

  • Compiling
forge build
  • Testing
forge test
  • Deployment

Deploying Vault.sol

forge create --rpc-url https://alfajores-forno.celo-testnet.org --constructor-args 10000000000000000000 --private-key <paste your private key here> src/Vault.sol:Vault

Output

[⠢] Compiling 2 files with 0.8.17
[⠰] Solc 0.8.17 finished in 3.04s
Compiler run successful
# Deployer: 0x85AbBd0605F9C725a1af6CA4Fb1fD4dC14dBD669
Vault Deployed to: 0x066F3BF47Eff52235b188c505E6C4e2aB5cbbaBf
Transaction hash: 0x58eef469142ffe24082b4ba4956a678c4c757137d8b7094160e5788369c88b3e    

Deploying RewardToken.sol

forge create --rpc-url https://alfajores-forno.celo-testnet.org --constructor-args 500000000--private-key <paste your private key here> src/RewardToken.sol:RewardToken

Output

[⠔] Compiling 1 files with 0.8.17
[⠃] Solc 0.8.17 finished in 4.67s
Compiler run successful
# Deployer: 0x85AbBd0605F9C725a1af6CA4Fb1fD4dC14dBD669
Token Deployed to: 0x116a6a86AA7DaA2320969d30BA10cA18E0DE21e4
Transaction hash: 0x341584db0df918849a36ed606feb7ab4f0d66142faa6261a15b7ebd0abd761a5
  • Demo

Click to interact with Dapp