This is my follow along from multiple solidity tutorials.
CTRL+Shift+P > 'keyboard shortcuts' VS KeyBoard Shortcuts:here
- settings > 'python formatting' > 'python>formatting: black'
-pip install py-solc-x (more actively maintained than py-solc)
- basic set and retrieve contract
- storage factory contract to create muliple simple storage contracts for different users.
- a contract that can get funding over a specific amount.
-
Deploy Simple Storage with Python
- pip install black
In VS Code,
- Interact with SimpleStorage using brownie framework
- init Initialize a new brownie project
- bake Initialize from a brownie-mix template
- pm Install and manage external packages
- compile Compile the contract source files
- console Load the console
- test Run test cases in the tests/ folder
- run Run a script in the scripts/ folder
- accounts Manage local accounts
-list
- networks Manage network settings
-list
- gui Load the GUI to view opcodes and test coverage
- analyze Find security vulnerabilities using the MythX API
-Deploying to testnet/mainnet brownie run SCRIPT --network rinkeby
- import FundMe contract and deploy.
- verify smart contract on Etherscan
- Verify Contract: HERE
- Enter code for smart contract
- imports with '@' wont work! Etherscan doesnt know NPM
- Code needs to be flattened
- Get API Key from Etherscan.io
- Add API key to .env file
- Add Publish to contract deployment
2 Problems: - priceFeed contract address is hardcoded to rinkeby network - not on the local ganache brownie uses Solutions - Forking - Mocking
- paramaterize the FundMe smart contract
- add to constructor which price feed to use on deploy
- pass price feed address on deploy function
- create addresses for different newtorks in brownie-config.yaml
- if not on development network us a mock
Mock contracts go in contracts/test folder
- publish source also must be determined by current chain set in brownie-config.yaml
- add deploy mock to functions.py
'brownie networks add '