K-Konstantinidis / Store-Data-Brownie

A smart contract to store and retrieve a value. Python scripts to deploy the contract & retrieve the most recent deployment. Python tests to test the contract.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Store-Data-Brownie

SimpleStorage.sol

A smart contract to:

  • Store and retrieve a value.
  • Store a person and their favourite number

Deploy.py

A python script to:

  • Connect to a Blockchain (Testnet, Mainnet)
  • Get an account safely:
    • From brownie if we want to test
    • A real one via the config & .env file
  • Deploy our contract
  • Retrieve the initial stored value
  • Create a new transaction to update the stored value
  • Retrieve the new stored value

Read_value.py

  • Retrieve the most recent deployed contract

Test_simple_storage.py

  • Test if the deployment is correct
  • Test if updating the value works correctly

Help with the project

To run the code there are some requirements. You must install:

pipx

Install pipx by running the following on the command line: python -m pip install --user pipx then python3 -m pipx ensurepath

For more information check: Install pipx

Brownie

Install Brownie by running the following on the command line: pip install eth-brownie

For more information check: Install Brownie

This is the Lesson 5 of the freeCodeCamp.org tutorial: https://www.youtube.com/watch?v=M576WGiDBdQ with more comments.

About

A smart contract to store and retrieve a value. Python scripts to deploy the contract & retrieve the most recent deployment. Python tests to test the contract.

License:MIT License


Languages

Language:Python 64.1%Language:Solidity 35.9%