Skip to content

chrisalexadams/ConsenSys-bootcamp-final-project

Repository files navigation

Project Description

alt text

Smart Contract Wallet is a wallet as a deployed smart contract that can hold Ethereum and any ERC20 token. It can also send and receive Ethereum and ERC20 tokens.

Build Status Coverage Status

Directory Structure 📜

  • contracts: Smart contracts source code
  • public : Create React App public folder
  • src: The frontend source code
    • src/web3 : Custom web3modal login logic
  • scripts : Scripts for deployment
  • test : Unit testing

Installing 🔧

1. Clone the repository and open in your editor

git clone https://github.com/chrisalexadams/blockchain-developer-bootcamp-final-project
cd blockchain-developer-bootcamp-final-project
code .

2. Follow these steps to install and compile

  • make a copy of .env.example and rename it to .env

  • fill in your credentials in .env

  • npm i
  • npx hardhat compile

Local Deployment and Testing

1. In a terminal, type

 npx hardhat node
  • You should see the following output:
Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/

Accounts
========

WARNING: These accounts, and their private keys, are publicly known.
Any funds sent to them on Mainnet or any other live network WILL BE LOST.
  • Then a list of 20 accounts will be displayed with 10000 ETH each.

2. Open another terminal and type

npx hardhat run scripts/deploy.js --network localhost
  • localhost is defined as port 8545 in hardhat.config.js
  • You should see the following output:
Deploying contracts with the account: 0x...
Account balance: 10000000000000000000000
Wallet address: 0x...

3. Open another terminal and type

npx hardhat test --logs

Deployment to Testnet

In order to use the contract as your wallet, you (as the owner) need to deploy it to the testnet.

  • To deploy to your choice of Testnet Network, you can use the following command:

    npx hardhat run scripts/deploy.js --network <testnet of choice>
  • To verify the source code, run this in the terminal:

    npx hardhat verify --network <testnet of choice> DEPLOYED_CONTRACT_ADDRESS

The contract is deployed by me (the owner) on the Rinkeby Testnet with the contract source code verified engaging in all functions:

  • receiveERC20
  • sendERC20
  • sendEther
  • receive()

Start the Frontend

In a terminal, type

npm start

Tools


ENS Address chrisa.eth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published