Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
11,211
77 commits
updated Apr 16, 2024
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.
Welcome to the repository for the Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition FreeCodeCamp course!
Rinkeby Faucet (Check the link token contracts page)
OR, use the Kovan ETH Faucet, just be sure to swap your metamask to kovan!
π» Code: https://github.com/PatrickAlphaC/simple_storage
uint256, int256, bool, string, address, bytes32π» Code: https://github.com/PatrickAlphaC/storage_factory
π» Code: https://github.com/PatrickAlphaC/fund_me
π» Code: https://github.com/PatrickAlphaC/web3_py_simple_storage
π» Code: https://github.com/PatrickAlphaC/brownie_simple_storage
brownie init
SimpleStorage.sol to the contracts folderbrownie compiledef main is brownie's entry pointdevelopment ganache chain that it createsmain functionaccounts
accounts[0]: Brownie's "default" ganache accounts
accounts.load("..."): Brownie's encrypted command line (MOST SECURE)
brownie accounts new <name> and enter your private key and a passwordaccounts.add(config["wallets"]["from_key"]): Storing Private Keys as an environment variable, and pulling from our brownie-config.yaml
dotenv: .env to your brownie-config.yaml and have a .env filetransaction.wait(1)test_simple_storage.pyassertbrownie testtest_updating_storagebrownie networks listlist index out of rangeget_account()networks.show_active()brownie consoleπ» Code: https://github.com/PatrickAlphaC/brownie_fund_me
helpful_scripts.py__init__.pypublish_source)
ETHERSCAN_TOKENnetworks in our brownie-config.yamltest_can_fund_and_withdrawpip install pytestmainnet-forkbrownie 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=8545brownie test --network mainnet-forktest_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.
π» Code: https://github.com/PatrickAlphaC/smartcontract-lottery
README.mdLottery.solstartLotteryblock keyword
block.difficultyblock.timestampkeccack256endLotteryreturns (type variableName)fulfillRandomnessoverridedeploy_lottery.pyget_account() refactoredget_contract
contract_to_mockContract.from_abivrfCoordinatorMock and adding mocksLinkToken and Mocksstart_lotterytx.wait(1) your last transactionenter_lotteryend_lotterytest_get_entrance_feepytest.skip (again)test_cant_enter_unless_startedtest_can_start_and_enter_lotterytest_can_pick_winner_correctlycallBackWithRandomnesstopicsπ» Code: https://github.com/smartcontractkit/chainlink-mix
π» Code: https://github.com/PatrickAlphaC/erc20-brownie-py
deploy_token.pyhelpful_scripts.py*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
get_weth.pywithdrawaave_borrow.pydepositπ» Code: https://github.com/PatrickAlphaC/nft-demo
SimpleCollectible.solcreateCollectible
_safeMintdeploy_and_create.pyAdvancedCollectible.solcreateCollectible (Advanced)
tokenIdToBreedsetTokenURI
_isApprovedOrOwnerindexed event keywordOPENSEA_URL to helpful_scriptscreate_collectible.pycreate_metadata.pyget_breedmetadata_templateupload_to_ipfsipfs daemonπ» Code: https://github.com/PatrickAlphaC/upgrades-mix
Box.solBoxV2.sol01_deploy_box.pyNote: 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
DappToken.solTokenFarm.sol
tokenIsAllowedaddAllowedTokensstakeTokensissueTokensgetUserTotalValuegetUserSingleTokenValuegetTokenValuesetPriceFeedContractunStakeTokensdeploy.py
test_set_price_feed_contracttest_stake_tokenstest_issue_tokenscreate-react-app
Main.tsx
brownie-config & build folder to our UIYourWallet
supportedTokensWalletBalanceethersproject/unitsBalanceMsgapproveuseContractFunctionuseEffectShoutout to Matt for the help on the front end!
Be sure to check out project grant programs!
And make today an amazing day!
98 followers Β· starred Nov 2021
604 followers Β· starred Nov 2021
117 followers Β· starred May 2022
31 followers Β· starred Sep 2021
Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
11,211
77 commits
updated Apr 16, 2024
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.
Welcome to the repository for the Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition FreeCodeCamp course!
Rinkeby Faucet (Check the link token contracts page)
OR, use the Kovan ETH Faucet, just be sure to swap your metamask to kovan!
π» Code: https://github.com/PatrickAlphaC/simple_storage
uint256, int256, bool, string, address, bytes32π» Code: https://github.com/PatrickAlphaC/storage_factory
π» Code: https://github.com/PatrickAlphaC/fund_me
π» Code: https://github.com/PatrickAlphaC/web3_py_simple_storage
π» Code: https://github.com/PatrickAlphaC/brownie_simple_storage
brownie init
SimpleStorage.sol to the contracts folderbrownie compiledef main is brownie's entry pointdevelopment ganache chain that it createsmain functionaccounts
accounts[0]: Brownie's "default" ganache accounts
accounts.load("..."): Brownie's encrypted command line (MOST SECURE)
brownie accounts new <name> and enter your private key and a passwordaccounts.add(config["wallets"]["from_key"]): Storing Private Keys as an environment variable, and pulling from our brownie-config.yaml
dotenv: .env to your brownie-config.yaml and have a .env filetransaction.wait(1)test_simple_storage.pyassertbrownie testtest_updating_storagebrownie networks listlist index out of rangeget_account()networks.show_active()brownie consoleπ» Code: https://github.com/PatrickAlphaC/brownie_fund_me
helpful_scripts.py__init__.pypublish_source)
ETHERSCAN_TOKENnetworks in our brownie-config.yamltest_can_fund_and_withdrawpip install pytestmainnet-forkbrownie 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=8545brownie test --network mainnet-forktest_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.
π» Code: https://github.com/PatrickAlphaC/smartcontract-lottery
README.mdLottery.solstartLotteryblock keyword
block.difficultyblock.timestampkeccack256endLotteryreturns (type variableName)fulfillRandomnessoverridedeploy_lottery.pyget_account() refactoredget_contract
contract_to_mockContract.from_abivrfCoordinatorMock and adding mocksLinkToken and Mocksstart_lotterytx.wait(1) your last transactionenter_lotteryend_lotterytest_get_entrance_feepytest.skip (again)test_cant_enter_unless_startedtest_can_start_and_enter_lotterytest_can_pick_winner_correctlycallBackWithRandomnesstopicsπ» Code: https://github.com/smartcontractkit/chainlink-mix
π» Code: https://github.com/PatrickAlphaC/erc20-brownie-py
deploy_token.pyhelpful_scripts.py*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
get_weth.pywithdrawaave_borrow.pydepositπ» Code: https://github.com/PatrickAlphaC/nft-demo
SimpleCollectible.solcreateCollectible
_safeMintdeploy_and_create.pyAdvancedCollectible.solcreateCollectible (Advanced)
tokenIdToBreedsetTokenURI
_isApprovedOrOwnerindexed event keywordOPENSEA_URL to helpful_scriptscreate_collectible.pycreate_metadata.pyget_breedmetadata_templateupload_to_ipfsipfs daemonπ» Code: https://github.com/PatrickAlphaC/upgrades-mix
Box.solBoxV2.sol01_deploy_box.pyNote: 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
DappToken.solTokenFarm.sol
tokenIsAllowedaddAllowedTokensstakeTokensissueTokensgetUserTotalValuegetUserSingleTokenValuegetTokenValuesetPriceFeedContractunStakeTokensdeploy.py
test_set_price_feed_contracttest_stake_tokenstest_issue_tokenscreate-react-app
Main.tsx
brownie-config & build folder to our UIYourWallet
supportedTokensWalletBalanceethersproject/unitsBalanceMsgapproveuseContractFunctionuseEffectShoutout to Matt for the help on the front end!
Be sure to check out project grant programs!
And make today an amazing day!
98 followers Β· starred Nov 2021
604 followers Β· starred Nov 2021
117 followers Β· starred May 2022
31 followers Β· starred Sep 2021