All Projects → smartcontractkit → full-blockchain-solidity-course-py

smartcontractkit / full-blockchain-solidity-course-py

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

Projects that are alternatives of or similar to full-blockchain-solidity-course-py

Web3swift
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions.
Stars: ✭ 237 (-95.57%)
Mutual labels:  dapp, smart-contracts, web3
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (-92.15%)
Mutual labels:  dapp, smart-contracts, web3
Eth.social
An Ethereum dApp for posting social events.
Stars: ✭ 17 (-99.68%)
Mutual labels:  dapp, smart-contracts, web3
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (-99.27%)
Mutual labels:  dapp, smart-contracts, web3
go-ethutil
Ethereum utility functions for Go.
Stars: ✭ 17 (-99.68%)
Mutual labels:  dapp, smart-contracts, web3
solidity-cli
Compile solidity-code faster, easier and more reliable
Stars: ✭ 49 (-99.08%)
Mutual labels:  dapp, smart-contracts, web3
typescript-eth-starter
🔌 Ethereum Dapp Basic Typescript Starter
Stars: ✭ 125 (-97.66%)
Mutual labels:  dapp, smart-contracts, web3
awesome-waves
Curated list of awesome things for development on Waves blockchain.
Stars: ✭ 60 (-98.88%)
Mutual labels:  dapp, smart-contracts, web3
nifty-game
🃏🎮A NFT(ERC721) card game build on Ethereum, Truffle, Ganache and hosting on IPFS.
Stars: ✭ 222 (-95.85%)
Mutual labels:  dapp, smart-contracts
wagmi
React Hooks for Ethereum
Stars: ✭ 1,691 (-68.39%)
Mutual labels:  dapp, web3
dApp-Builder
No description or website provided.
Stars: ✭ 108 (-97.98%)
Mutual labels:  dapp, web3
Astar
The dApp hub for blockchains of the future
Stars: ✭ 533 (-90.04%)
Mutual labels:  dapp, web3
ethereum-playbook
CLI tool that configures and deploys Ethereum DApp infrastructures using a static specification. 📚📖
Stars: ✭ 20 (-99.63%)
Mutual labels:  dapp, smart-contracts
web3-starter
An opinionated web3 starter for building dApps
Stars: ✭ 67 (-98.75%)
Mutual labels:  dapp, web3
core
SIREN Core Smart Contracts
Stars: ✭ 39 (-99.27%)
Mutual labels:  dapp, smart-contracts
HealthCare-Insurance-Ethereum
Medical insurance claiming DApp which uses a Multi-Sig type approach to grant claim (ConsenSys project)
Stars: ✭ 65 (-98.78%)
Mutual labels:  dapp, smart-contracts
blockhead
Crypto portfolio tracker, DeFi dashboard, NFT viewer and data explorer for the Ethereum/EVM-based blockchain ecosystem and the web 3.0-powered metaverse https://gitcoin.co/grants/2966/blockhead
Stars: ✭ 41 (-99.23%)
Mutual labels:  smart-contracts, web3
eth-sdk
Type-safe, lightweight SDKs for Ethereum smart contracts
Stars: ✭ 283 (-94.71%)
Mutual labels:  dapp, web3
web3
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.
Stars: ✭ 609 (-88.61%)
Mutual labels:  dapp, web3
ar-nft
👾 A React Native app to visualize your NFTs in AR
Stars: ✭ 71 (-98.67%)
Mutual labels:  dapp, web3

Big Update: New Rinkeby Faucet Located Here. You can find Backup Faucets 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

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 Programatic 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

Lesson 7: SmartContract Lottery

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

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

💻 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

💻 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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].