Git Product home page Git Product logo

brownie's People

Contributors

4rgon4ut avatar 7xaquarius avatar acolytec3 avatar banteg avatar blinkystitt avatar bobthebuidler avatar calina-c avatar charles-cooper avatar crawfordleeds avatar danhper avatar dmuhs avatar evantayloryates avatar fubuloubu avatar iamdefinitelyahuman avatar jbargu avatar mariuspod avatar matnad avatar omarish avatar patrickalphac avatar poolpitako avatar scowley4 avatar shuklaayush avatar skellet0r avatar skyge avatar subos2008 avatar tbrent avatar themacexpert avatar tritium-vlk avatar tserg avatar yerimb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brownie's Issues

Expand gas profiling

Create a new mode specifically for gas profile comparisons that integrates with git to run the same test across multiple branches and output the results.

This could also force a rethink about the brownie project folder structure..

Ability to set / check EVM version

The version of the EVM is currently set in solc as well as ganache. It's possible to have different settings for each, which causes issues deploying contracts. There should be a simple way to check / modify the setting in both places at once.

Support for ganache evm methods

Adding support for ganache's evm_snapshot, evm_revert, evm_increaseTime, and evm_mine will greatly increase efficiency when running tests.

callbacks on state changes

Something like this...

notify.changed(token.balanceOf, 0x12345, callback_fn)

So that you can have functions automatically execute based on state changes in the blockchain. Could have a lot of simple premade ones... a sound is played, funds are sent, etc

optionally use debug_traceTransaction

-Display internal transfers
-Retrieve return values from transactions
-Display log events on reverted transactions (when estimateGas is disabled)

Use of debug_traceTransaction is heavy on a node and not available from infura, so this should be an optional config setting.

Simplify retrieving data from events

Instead of:

id_ = tx.events[2]['data'][0]['value']

it would be much simpler to type:

id_ = tx.events['NewAuthority']['id']

Need to give this some thought. Multiple firings of the same event in the same tx will complicate it, but there must be a way..

Improvements to Documentation

  • How libraries are handled
  • How brownie handles type conversions - requires #57
  • Debugging
  • Coverage evaluation
  • Return value formats
  • Instructions for using geth instead of ganache - requires #87 (sort of, added a local RPC section)
  • Using other networks
  • Working with multiple projects at once
  • The Brownie GUI
  • brownie.test API
  • Contributing

Improvements to accounts and contract classes

  • apply checksum to strings before doing comparisons
  • highlight ContractTx and ContractCall classes in a different color when using dir() - or add a new method functions() ?
  • some builtin methods should not be available - possibly sub-typing list and str is the wrong approach

Coverage evalation - rethink opview's relationship to Brownie

brownie/test/coverage.py is by far the messiest, hardest to follow code in this project. It's only use is to evaluate test coverage for later visualization in opview. This code should be cleaned up, commented, and potentially moved out of brownie and into opview, so that the test coverage tooling can be used on non-brownie projects.

Add config setting to remove revert error strings

Issue

  • During tests it's useful to have error strings in every revert/require, so we can make sure a function is failing at the expected point
  • Added gas costs make the strings less attractive when deploying on the mainnet

Idea

  • Brownie should have a config setting that automatically regex's and strips a contract or any error strings that begin with "dev:" before deploying it on specific networks

We are already using this string format in SFT, so this functionality will be added at some point in the near(-ish) future.

Compiler - cleanup and code refactor

utils/compiler.py has some excessively long functions and likely redundant code that wasn't dealt with in the move from 0.9.5 to 1.0.0b1. Additionally, network.contract.py line 62 is modifying the build data, and it's being dealt with via copy.deepcopy in the compiler which is hacky af.

Need to properly deal with this module and bring it in line with the rest of the project.

re-introduce accounts.mnemonic method

In making brownie install via pip I came up with dependency conflicts and realized that the two1 library handling mnemonics hasn't been maintained in over 2 years.

With commit 616122f I've temporarily removed the accounts.mnemonic method. I will reintroduce it once ethereum/eth-account#33 is merged, or if another solution presents itself.

Add native command to compile the contracts

Hi,

Would it be possible to have a native brownie compile or brownie build command?

It's common to want to compile the contracts without running the tests or a specific script. It will also facilitate the integration with third-party tools; we are looking at adding native brownie support to all the crytic tools (including Slither, Echidna and Manticore).

Thanks!

Use compile in console

Instead of the current design, the brownie console should use compile and check for SyntaxError and IndentationError to determine if there are syntax errors or if the user is entering a multiline statement. The current approach can lead to a strange form of hell where syntax is impossibly broken but the statement won't end due to uneven brackets.

option to not wait for confirmations

After broadcasting a tx, it should be possible to immediately return to the console. Should also be able to broadcast subsequent tx's before the previous one confirms, or replace one that isn't confirmed.

failed to GET http://worldclockapi.com/api/json/est/now with status 403 Forbidden:

Error message -

Error 403 - This web app is stopped.
The web app you have attempted to reach is currently stopped and does not accept any requests. Please try to reload the page or visit it again soon.

If you are the web app administrator, please find the common 403 error scenarios and resolution here. For further troubleshooting tools and recommendations, please visit Azure

Steps to reproduce:

  1. git clone https://github.com/HyperLink-Technology/brownie.git
  2. cd /brownie
  3. docker build .

Version on pip lacks the web3 dependency

Hi,

You might be already aware, but if brownie is installed through pip, web3 will not be installed, leading to this error:

ModuleNotFoundError: No module named 'web3'

An installation through git does not have the issue.

Better transaction verbosity

Instead of just:

Transaction sent: 0x8600fa55b6dd527913b55b97ac7e0e390a1f1b6bc1d5bb6db6aede83128e60d5
Transaction confirmed - block: 17 gas spent: 45692

it would be nice to see the contract name, and name of the function being called.

Improvements to verbosity for test / coverage

  • Fix numbering when tests fail or skip
  • Show count/total across all tests whenever starting a new module
  • Show total time to complete each test module and to complete all tests
  • Include contract name with function in coverage report (SafeMath.add instead of just add)
  • Show combined coverage % for entire contract

Error handling around incorrect event ABIs

The topic for an event will be identical regardless of if values are indexed or not, but eth_event will fail if the provided ABI doesn't have the same indexing. Need some error handling in place for this situation.

Add support for Vyper!

Current integration TODO list:

  • basic compiliation and interaction
  • minification
  • dependencies
  • only recompile if changed
  • decimal data type
  • statement coverage
  • branch coverage
    • if/else
    • assert
  • custom error strings
    • over/underflow checks
    • out-of-bounds array index
    • paying to a nonpayable function
    • modulus 0
  • dev revert strings
  • updates to GUI
  • test cases
  • documentation

Add custom Exceptions

With 1.0.0 release, exceptions now all live at brownie/exceptions.py. Need to go through the code and find all the places that built-in exceptions are being used but don't quite fit, and create more specific / applicable custom exception classes.

Refactor code for cli/test and cli/coverage

Related to #65 - There is a lot of overlap in the code between these modules, they should be refactored, cleaned up, simplified..

Common code could be moved to a module in brownie/tests perhaps.

Update readthedocs based on 1.0 changes

Need to through the docs in detail, and update them to reflect all the new changes. Also consider a more general reorganization.

Priority is on installation and quick start, in the mean time a disclaimer should be in place warning that some sections are out of date.

Should also address #41 in this update.

Change how coverage reports are saved

Reports should be stored in separate files. Right now if you run a single test you lose the results for all previous tests. In a large project it can take a long time to execute the entire test suite, losing all the coverage data is not fun.

When brownie checks if a contract should be recompiled, the same process can be used to delete coverage info for tests that have been changed.

optionally do not use estimateGas

Include it as an optional setting in config.json - allow transactions to have a manual gas limit set so that they can be broadcasted even if they will revert. This will also require modifying how contract transactions are formed using Account.

Contract input - weak types

Brownie is much more forgiving of types than web3.py when calling a contract.

_format_inputs in contract.py handles type conversions, but when the type is too far off what's expected, it sometimes raises very confusing exceptions. Exception handling here needs to be expanded upon heavily. The documentation should explain exactly what is and isn't allowed, and how types are implicitly converted.

console improvements

-allow commands to span multiple lines
-better error reporting: "SyntaxError on line 1" is not very useful

Use pytest for testing

Fairly self explanatory. pytest is well known and battle tested, so probably a better approach than my own self-rolled alternative :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.