• Stars
    star
    10,703
  • Rank 3,183 (Top 0.07 %)
  • Language
  • License
    MIT License
  • Created about 3 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition

Big Update: New Sepolia Faucet Located Here. \Kovan, Ropsten, and Rinkeby have been deprecated. Goerli Still works but we highly recommend Sepolia as its proof of stake based.

You'll need to verify via Twitter to get ETH & LINK. You can find Backup Faucets here.

Additionally, lesson 7 uses Chainlink VRF v1 instead of v2, you can find the docs for Chainlink VRFv1 here.

YouTube Video


Solidity, Blockchain, and Smart Contract Course – Beginner to Expert Python Tutorial


Welcome to the repository for the Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition FreeCodeCamp course!

Table of Contents

Resources For This Course

Questions

Windows Support

Hiccups/Issues from the Video

Lesson 0: Welcome To Blockchain

What is a Blockchain?

Making Your First Transaction

How Do Blockchains Work?

Consensus

The Future

Miscellaneous

Lesson 1: Welcome to Remix! Simple Storage

💻 Code: https://github.com/PatrickAlphaC/simple_storage

Everything in this section can be read about in the Solidity Documentation

Remix

Basic Solidity

  • Versioning
  • Compiling
  • Contract Declaration
  • Types & Declaring Variables
    • uint256, int256, bool, string, address, bytes32
  • Default Initializations
  • Comments
  • Functions
  • Deploying a Contract
  • Calling a public state-changing Function
  • Visibility
  • Scope
  • View & Pure Functions
  • Structs
  • Intro to Storage
  • Arrays - Dynamic & Fixed sized
  • Compiler Errors and Warnings
  • Memory
  • Mappings
  • SPDX License
  • Recap

Deploying to a "Live" network

  • A testnet or mainnet
  • Find a faucet here
  • Connecting Metamask
  • Interacting with Deployed Contracts
  • The EVM

Lesson 2: Storage Factory

💻 Code: https://github.com/PatrickAlphaC/storage_factory

Inheritance, Factory Pattern, and Interacting with External Contracts

  • Factory Pattern
  • Imports
  • Deploy a Contract From a Contract
  • Interact With a Deployed Contract
  • Recap

Lesson 3: Fund Me

💻 Code: https://github.com/PatrickAlphaC/fund_me

Payable, msg.sender, msg.value, Units of Measure

Chainlink Oracles

Importing from NPM and Advanced Solidity

  • Decimals/Floating Point Numbers in Solidity
  • latestRoundData
  • Importing from NPM in Remix
  • Interfaces
    • Introduction to ABIs
  • Getting Price Feed Addresses
  • getPrice
  • Tuples
    • Unused Tuple Variables
  • Matching Units (WEI/GWEI/ETH)
  • getConversionRate
  • Matching Units (Continued)
  • SafeMath & Integer Overflow
  • Setting a Threshold
  • Require
  • Revert
  • Withdraw Function
  • Transfer
  • Balance
  • this
  • Contract Owners
  • Constructor
  • ==
  • Modifiers
  • Resetting
  • for loop
  • Array Length
  • Forcing a Transaction
  • Recap

Lesson 4: Web3.py Simple Storage

💻 Code: https://github.com/PatrickAlphaC/web3_py_simple_storage

Installing VSCode, Python, and Web3

Our First Python Script with Web3.py - Deploying a Contract

Interacting with Our Contract in Python & Web3.py

  • 2 Things you always need
    1. Contract Address
    2. Contract ABI
  • Getting address from transaction receipt
  • Calling a view function with web3.py
    • Call vs Transact
  • Updating State with Web3.py
  • ganache-cli
  • Working with ganache-cli
  • Open a new terminal in the same window
  • Deploying to a testnet
  • Infura
  • Alchemy
  • Using Infura RPC URL / HTTP Provider
  • Chain Ids
  • Wow this seems like a lot of work... Is there a better way?

Lesson 5: Brownie Simple Storage

💻 Code: https://github.com/PatrickAlphaC/brownie_simple_storage

Brownie Introduction

Installing Brownie

Brownie Simple Storage Project

  • A new Brownie project with brownie init
    • Project Basic Explanation
  • Adding SimpleStorage.sol to the contracts folder
  • Compiling with brownie compile
  • Brownie deploy script
    • def main is brownie's entry point
  • brownie defaults to a development ganache chain that it creates
  • Placing functions outside of the main function
  • brownie accounts
    • 3 Ways to Add Accounts
      1. accounts[0]: Brownie's "default" ganache accounts
        • Only works for local ganache
      2. accounts.load("..."): Brownie's encrypted command line (MOST SECURE)
        • Run brownie accounts new <name> and enter your private key and a password
      3. accounts.add(config["wallets"]["from_key"]): Storing Private Keys as an environment variable, and pulling from our brownie-config.yaml
        • You'll need to add dotenv: .env to your brownie-config.yaml and have a .env file
  • Importing a Contract
  • Contract.Deploy
  • View Function Call in Brownie
  • State-Changing Function Call in Brownie / Contract Interaction
  • transaction.wait(1)

Testing Basics

  • test_simple_storage.py
  • Arrange, Act, Assert
  • assert
  • brownie test
  • test_updating_storage
  • Pytest / Brownie Test Tips
  • Deploy to a Testnet
  • brownie networks list
  • Development vs Ethereum
    • Development is temporary
    • Ethereum networks persist
  • RPC URL / HTTP Provider in Brownie
  • The network flag
    • list index out of range
  • get_account()
  • networks.show_active()
  • build/deployments
  • Accessing previous deployments
  • Interacting with contracts deployed in our brownie project

[Brownie console]

  • brownie console

Lesson 6: Brownie Fund Me

💻 Code: https://github.com/PatrickAlphaC/brownie_fund_me

Introduction

  • Setup

Dependencies, Deploying, and Networks

  • Dependencies
  • chainlink-brownie-contracts
  • remappings
  • Deploy Script (V1)
  • helpful_scripts.py
  • __init__.py
  • Deploy to Rinkeby
  • Contract Verification (publish_source)
    • The Manual Way
      • "Flattening"
    • The Programmatic Way
    • Interacting with Etherscan
  • Deploying to Local Chains
  • Introduction to Mocking
  • Constructor Parameters
  • networks in our brownie-config.yaml
  • Copying Mock Contracts from chainlink-mix
  • Deploying and using our mock
  • Refactoring
  • Deploying to a persistent ganache
  • brownie attach
  • Adding a persistent brownie network
  • resetting a network build

Funding and Withdrawing Python Scripts

  • Whoops! Let's fix an issue...
  • Fund Script
  • Withdraw Script

Testing across networks

  • test_can_fund_and_withdraw
  • default networks
  • pytest pip install pytest
  • pytest.skip
  • brownie exceptions
  • mainnet-fork
  • Custom mainnet fork
  • Adding a development brownie network
    • brownie networks add development mainnet-fork-dev cmd=ganache-cli host=http://127.0.0.1 fork='https://infura.io/v3/$WEB3_INFURA_PROJECT_ID' accounts=10 mnemonic=brownie port=8545
  • Alchemy
  • brownie test --network mainnet-fork
  • brownie ganache vs local ganache vs mainnet-fork vs testnet...

Git

Compatibility with Ganache UI

  • test_only_owner_can_withdraw() gives below error if the selected network is Ganache UI::
E           ValueError: Execution reverted during call: 'VM Exception while processing transaction: revert'. This transaction will likely revert. If you wish to broadcast, include `allow_revert:True` as a transaction parameter.

More information here.

Lesson 7: SmartContract Lottery

💻 Code: https://github.com/PatrickAlphaC/smartcontract-lottery

Chainlink VRF v1 docs

Introduction

  • Add a README.md
  • Defining the project
  • Is it decentralized?

Lottery.sol

Testing Lottery.sol

  • deploy_lottery.py
  • get_account() refactored
  • get_contract
    • contract_to_mock
    • Contract.from_abi
  • Adding the parameters to deploying to lottery
  • vrfCoordinatorMock and adding mocks
  • LinkToken and Mocks
  • Successful Ganache Deployment!
  • Python Lottery Scripts/Functions
    • start_lottery
    • Brownie tip: Remember to tx.wait(1) your last transaction
    • enter_lottery
    • end_lottery
  • Funding with LINK
  • brownie interfaces
  • Waiting for callback
  • Integration Tests & Unit Tests
  • Test all lines of code
  • test_get_entrance_fee
  • pytest.skip (again)
  • test_cant_enter_unless_started
  • test_can_start_and_enter_lottery
  • test_can_pick_winner_correctly
  • Events and Logs
  • callBackWithRandomness

Lottery.sol Testnet Deployment

Lesson 8: Chainlink Mix

💻 Code: https://github.com/smartcontractkit/chainlink-mix

Brownie Mixes

Lesson 9: ERC20s, EIPs, and Token Standards

💻 Code: https://github.com/PatrickAlphaC/erc20-brownie-py

Lesson 10: Defi & Aave

*NOTE: This repo is now archived as kovan is no longer supported. You can still follow along with the learning, but know the code may not work the same on a different testnet.

💻 Code: https://github.com/PatrickAlphaC/aave_brownie_py_freecode

Defi Intro

Aave UI

Programmatic Interactions with Aave

Testing

Lesson 11: NFTs

💻 Code: https://github.com/PatrickAlphaC/nft-demo

Non-Technical Explainer

Simple NFT

SimpleCollectible Testing

  • What else with NFTs?

Advanced NFT

  • AdvancedCollectible.sol
  • Dungeons and Dragons Example
  • Double Inherited Constructors
  • createCollectible (Advanced)
    • tokenIdToBreed
  • Working with in-flight Chainlink VRF requests
  • Download the NFT images from the nft-mix
  • setTokenURI
    • _isApprovedOrOwner
  • Emit events when you update mappings
  • indexed event keyword

Advanced deploy_and_create

  • Move OPENSEA_URL to helpful_scripts
  • Deploying AdvancedCollectible
    • Opensea testnet is only compatible with Rinkeby
  • Rinkeby Chainlink VRF Contract Addresses
  • Speeding through adding functions from previous projects
  • Deploy to Rinkeby
  • create_collectible.py
  • A quick unit test
  • A quick integration test

Creating Metadata & IPFS

Lesson 12: Upgrades

💻 Code: https://github.com/PatrickAlphaC/upgrades-mix

Introduction to upgrading smart contracts

Upgrades-mix and code

  • Setup
  • Box.sol
  • BoxV2.sol
  • Getting the proxy contracts
  • Openzeppelin Proxy Github
  • 01_deploy_box.py
  • Hooking up a proxy to our implementation contract
  • (Optional) Creating a Gnosis Safe
  • Initializers
  • Encoding Initializer Function
  • Assigning ABI to a proxy
  • Running the script
  • Upgrade Python Function

Testing Upgrades

  • Testing our proxy
  • Testing our upgrades

Upgrades on a testnet

Bonus Lesson 13: Full Stack Defi

Note: This section is archived as kovan is now deprecated. If you're looking to learn more Full-stack, check out the full stack portions of the hardhat/javascript video.

Link to hardhat/javascript video with more full-stack examples: https://github.com/smartcontractkit/full-blockchain-solidity-course-js

💻 Code: https://github.com/PatrickAlphaC/defi-stake-yield-brownie-freecode

  • FreeCodeCamp React
  • What are we building?
  • Setup
  • DappToken.sol
  • TokenFarm.sol
    • tokenIsAllowed
    • addAllowedTokens
    • mapping of a mapping
    • stakeTokens
    • issueTokens
    • getUserTotalValue
    • getUserSingleTokenValue
    • getTokenValue
    • setPriceFeedContract
    • unStakeTokens
    • Can this be reentrancy attacked?

Defi Stake Yield Brownie Scripts & Tests

  • deploy.py
    • Deploying DappToken
    • Deploying TokenFarm
    • Adding allowed tokens
  • ERC20 Kovan Faucet
    • If the link above does not work, you can get another ERC20 token using this faucet: Weenus ERC20 Faucet
  • Mocking our ERC20s

Testing our Defi Stake Yield Brownie Dapp

  • test_set_price_feed_contract
  • test_stake_tokens
  • Fixtures
  • test_issue_tokens
  • Now you try on tests!

Front End / Full Stack

  • Front End Introduction
  • Typescript
  • React
  • useDapp
  • npx
  • yarn
  • create-react-app
    • Layout
  • Testing Front End
  • yarn && yarn start
  • Connecting our wallets
    • Install useDapp
    • Header Component
    • Connect Button
  • Material-UI
  • Making our button nicer
  • Main.tsx
    • Sending brownie-config & build folder to our UI
    • Helper Config
    • TypeScript error suppression
    • Getting addresses
    • Ethers
    • Only support kovan
  • YourWallet
    • supportedTokens
    • State Hooks
    • Showing tokens
    • WalletBalance
    • ethersproject/units
    • BalanceMsg
    • Stake Form
    • Calling approve
    • useContractFunction
    • useEffect
    • Notifications
    • Make it pretty
    • Alerts

Shoutout to Matt for the help on the front end!

Closing and Summary

Security

Where do I go now?

Learning More

Community

Hackathons

Be sure to check out project grant programs!

Vyper

From solidity course to vyper

And make today an amazing day!

More Repositories

1

full-blockchain-solidity-course-js

Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript
12,442
star
2

chainlink

node of the decentralized oracle network, bridging on and off-chain computation
Go
6,970
star
3

hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
JavaScript
1,203
star
4

chainlink-mix

Working with smart contracts with eth-brownie, python, and Chainlink.
Solidity
484
star
5

defi-minimal

This repo is dedicated to making minimal repos of existing defi primatives.
JavaScript
473
star
6

documentation

https://docs.chain.link The Chainlink developer documentation website for Smart Contract Devs and Node Operators
MDX
398
star
7

foundry-starter-kit

Solidity
331
star
8

external-adapters-js

Monorepo containing JavaScript implementation of external adapters
TypeScript
269
star
9

truffle-starter-kit

An example smart contract utilizing Chainlink
JavaScript
258
star
10

starter-kits

A repo of starter kits for working with various languages and frameworks across the smart contract ecosystem.
238
star
11

foundry-starter-kit-old

Solidity
204
star
12

smart-contract-examples

Example and sample projects
Solidity
186
star
13

solana-starter-kit

Example code for using Chainlink on Solana
JavaScript
172
star
14

chainlink-brownie-contracts

A repository for automatically using the latest chainlink repo from the core chainlink repo.
Solidity
168
star
15

chainlink-ruby

Easily connect your applications to blockchains
Ruby
157
star
16

functions-hardhat-starter-kit

JavaScript
147
star
17

chainlink-polkadot

Go
139
star
18

LinkToken

LINK Token Contracts for the Chainlink Network
Solidity
132
star
19

ccip

Cross Chain Interoperability Protocol
Go
119
star
20

huff-starter-kit

A template repo to work with huff smart contracts and learn about low level EVM opcodes. Also Horse ♘.
Solidity
101
star
21

apeworx-starter-kit

A repo dedicated to showing how to make smart contracts in a purely pythonic environment
Python
90
star
22

Web3_tutorial_Chinese

Solidity
90
star
23

chainlink-solana

Go
81
star
24

blockchain-developer-hub

Dive into blockchain and smart contract development.
JavaScript
81
star
25

ccip-starter-kit-foundry

This project demonstrates a couple of basic Chainlink CCIP use cases
Solidity
73
star
26

chainlink-fullstack

Full stack starter project showcasing Chainlink products on Ethereum (EVM)
TypeScript
68
star
27

libocr

libocr consists of a Go library and a set of Solidity smart contracts that implement the Chainlink Offchain Reporting Protocol
Go
68
star
28

hardhat-chainlink

Integrates Chainlink into Hardhat projects. This package is currently in the BETA testing phase and is not recommended for production usage yet.
TypeScript
65
star
29

solidity-cborutils

A library for encoding CBOR in Solidity.
Solidity
64
star
30

dapptools-starter-kit

Solidity
62
star
31

chainlink-testing-framework

A testing framework for smart contracts and Chainlink nodes
Go
61
star
32

ccip-read

TypeScript
60
star
33

ccip-cross-chain-nft

This project demonstrates how to mint an NFT on one blockchain from another blockchain using Chainlink CCIP
Solidity
60
star
34

chainlink-starknet

Go
58
star
35

foundry-chainlink-toolkit

A plugin to use Chainlink products/services in Foundry
Solidity
57
star
36

ccip-starter-kit-hardhat

This project demonstrates a couple of basic Chainlink CCIP use cases
TypeScript
56
star
37

prediction-game

Rugby prediction game using Chainlink Functions, Automation, and CCIP.
TypeScript
55
star
38

chainlink-local

The Chainlink CCIP Local Simulator, visit documentation by clicking the link below:
Solidity
47
star
39

smart-contract-db

This repository is an archive. This project has been superseded by blockchain.education https://github.com/smartcontractkit/blockchain-developer-hub
TypeScript
44
star
40

ccip-defi-lending

CCIP Launch Defi Demo
JavaScript
43
star
41

external-initiator

Initiate Chainlink job runs from external sources
Go
39
star
42

chainlink-solana-demo

Showing how to deploy a Solana program using Chainlink Price Feeds
TypeScript
37
star
43

chainlink-automation-templates

Real-world sample projects using Chainlink Automation
Solidity
35
star
44

usechainlinkfunctions

TypeScript
31
star
45

near-protocol-contracts

Rust
26
star
46

functions-toolkit

An NPM package with collection of tools that can be used for working with Chainlink Functions.
TypeScript
25
star
47

chainlink-cosmos

Go
25
star
48

functions-deepdive-constellation2023

Deepdive Workshop For Constellation 2023 Hackathon
JavaScript
24
star
49

chainlink-common

SDK for building Chainlink Services and Plugins
Go
24
star
50

ccip-cross-chain-name-service

This project is an educational example of how to create a minimal cross-chain name service using Chainlink CCIP
TypeScript
24
star
51

run-functions-dapp

Demo dApp using Chainlink Functions to bring web2 data on-chain.
TypeScript
23
star
52

wasp

Protocol-agnostic load testing library for Go
Go
23
star
53

env-enc

TypeScript
23
star
54

devnet

An Ethereum development network with preset configs for easy testing.
Makefile
22
star
55

Blockchain-RPC-Exporter

Prometheus exporter for EVM compatible RPC endpoints.
Python
20
star
56

chainlink-functions-demo-app

TypeScript
18
star
57

schemas

specification for offering and requesting off-blockchain services
17
star
58

paypal-adapter

TypeScript
17
star
59

ccip-owner-contracts

A set of smart contracts used for administering Chainlink contracts, most notably CCIP
Solidity
16
star
60

chainlink-github-actions

Common action to run chainlink-testing-framework based tests in github ci
TypeScript
16
star
61

risk-management-network

Rust
16
star
62

wei_watchers

A service for push notifications of Ethereum logs and account balances.
Ruby
15
star
63

chain-selectors

Go
15
star
64

arbitrum-quickstart

JavaScript
14
star
65

solc-api

minimal Solidity compiler service
JavaScript
14
star
66

chainlink-env

Chainlink k8s environment library
Go
14
star
67

datastreams-demo

Demo dApp using Chainlink Data Streams.
TypeScript
13
star
68

operator-ui

TypeScript
13
star
69

hello_chainlink

chainlink demos
JavaScript
12
star
70

ccip-tic-tac-toe

TypeScript
12
star
71

chainlink-staking-v0.2-public-guide

12
star
72

wsrpc

A bi-directional Websockets RPC library
Go
12
star
73

quickstarts-historical-prices-api

TypeScript
12
star
74

functions-lens-eventbrite

Solidity
12
star
75

tdh2

An implementation of the TDH2 protocol by Shoup & Gennaro (paper link https://www.shoup.net/papers/thresh1.pdf)
Go
11
star
76

chainlink-RSK

Solidity
11
star
77

functions-the-graph-uniswap

Solidity
11
star
78

chainlink-automation

Go
10
star
79

chainlink-data-streams

Go
10
star
80

workshop-distributed-news

Solidity
10
star
81

solana-prediction-game

JavaScript
10
star
82

builder

A docker build file for chainlink
Dockerfile
10
star
83

chainlink-vrf

OCR2VRF (in development, do not use in production)
Go
10
star
84

rwa-tokenization

TypeScript
10
star
85

cairo-starter-kit

The boilerplate code for getting started with the usage of Chainlink services on Starknet
TypeScript
9
star
86

hardhat-network

Deploys a basic hardhat chain for testing
Dockerfile
9
star
87

bq-example-contract

JavaScript
8
star
88

.github

TypeScript
8
star
89

ea-framework-js

TypeScript
8
star
90

ccip-liquidation-protector

This project demonstrates how to automate preventing DeFi liquidations & optimizing interest rates on multiple blockchains using Chainlink CCIP, Chainlink Automation and Chainlink Functions
TypeScript
8
star
91

chainlink-node-compose

Docker Compose script for launching multiple chainlink nodes
Shell
8
star
92

substrate-adapter

Go
7
star
93

link-token-sidechain-evm

LINK Token On EVM Sidechains
Solidity
7
star
94

push-gha-metrics-action

Shell
7
star
95

DEVREL-collaborative-nft-tutorial

Solidity
7
star
96

timelock-worker

Daemon to poll and execute scheduled transactions from a Timelock contract.
Go
7
star
97

blockchain-ecosystem-map

JavaScript
7
star
98

chainlink-solhint-rules

CLL custom Solhint rules
JavaScript
7
star
99

functions-google-bigquery

Demonstration of accessing data from Google BigQuery via Chainlink Functions
JavaScript
6
star
100

chainlink-terra-feeds-demo

Showing how to deploy a Terra smart contract which utilizes Chainlink Data Feeds
Rust
6
star