Skip to content

Instantly share code, notes, and snippets.

@gudongfeng
Last active January 31, 2022 00:48
Show Gist options
  • Save gudongfeng/cefa8379d3106cc836f5e54aee8f8974 to your computer and use it in GitHub Desktop.
Save gudongfeng/cefa8379d3106cc836f5e54aee8f8974 to your computer and use it in GitHub Desktop.

Frequently used commands

  • brownie run scripts/deploy.py: Run the deploy script to deploy the smart contract
  • brownie complie: Complie the whole project
  • brownie console: Open the brownie console and interact with the smart contract

For accounts

  • brownie accounts new <Account_Name>: Link a real world account in brownie for deployment/testing purpose
  • brownie accounts list: List the accounts you can use in borwnie

For testing

  • brownie test: Run all test suit
  • brownie test -k <Test_Function_Name>: Run a single test
  • brownie test --pdb: Run test in debug mode, you can experiment with value in the variable
  • brownie test -s: Disable stdout capture when running tests

For network

  • brownie networks list: Check all the blockchain networks supported by brownie

Introduce solidy remapping so that vscode can recognize the imported package. Run brownie compile first.

{
    "solidity.remappings": [
        "@openzeppelin/=/Users/dgu/.brownie/packages/OpenZeppelin/openzeppelin-contracts@3.4.0",
        "@chainlink/=/Users/dgu/.brownie/packages/smartcontractkit/chainlink-brownie-contracts@1.1.1"
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment