Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate NatSpec info in the console #378

Closed
iamdefinitelyahuman opened this issue Apr 3, 2020 · 0 comments · Fixed by #395
Closed

Integrate NatSpec info in the console #378

iamdefinitelyahuman opened this issue Apr 3, 2020 · 0 comments · Fixed by #395
Labels
enhancement New feature or request
Milestone

Comments

@iamdefinitelyahuman
Copy link
Member

Overview

In the console it should be possible to access Natspec info about a contract function.

Specification

The repr of a function currently shows the signature:

>>> kyber.swapTokenToToken
<ContractTx 'swapTokenToToken(address src, uint256 srcAmount, address dest, uint256 minConversionRate)'>

There should be an info() (or natspec()?) method to get an expanded view of this data:

>>> kyber.swapTokenToToken.info()
swapTokenToToken(address src, uint256 srcAmount, address dest, uint256 minConversionRate)
@dev makes a trade between src and dest token and send dest tokens to msg sender
@param src Src token
@param srcAmount amount of src tokens
@param dest Destination token
@param minConversionRate The minimal conversion rate. If actual rate is lower trade is canceled.
@return amount of actual dest tokens

It may also be possible to use the NatSpec to give more meaningful exception messages when contract inputs are given improperly.

@iamdefinitelyahuman iamdefinitelyahuman added the enhancement New feature or request label Apr 3, 2020
@iamdefinitelyahuman iamdefinitelyahuman added this to the Brownie 1.7.0 milestone Apr 5, 2020
@iamdefinitelyahuman iamdefinitelyahuman mentioned this issue Apr 8, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant