-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
language design
Any changes to the language, e.g. new featuresAny changes to the language, e.g. new features
Milestone
Description
Test case
pragma solidity ^0.5.0;
/// @title A simulator for Bug Bunny, the most famous Rabbit
/// @author Warned Bros
/// @notice You can use this contract for only the most basic simulation
/// @dev All function calls are currently implement without side effects
contract BugsBunny {
/// @author Bob Clampett
/// @notice Determine if Bugs will or will not accept given food
/// @dev Food must be provided in UTF-8 format
/// @param _food The name of a food to evaluate (English)
/// @return true if Bugs will eat it, false otherwise
function doesEat(string calldata _food) external pure returns (bool) {
return keccak256(bytes(_food)) == keccak256("carrot");
}
/// @title example of title
/// @author example of author
/// @notice example of notice
/// @dev example of dev
/// @param example of param
/// @return example of return
string public constant name = "Bugs";
}Run the command:
solc -o outputDirectory --userdoc --devdoc tmp.solThen test output with:
jq .methods outputDirectory/*Expected outcome
Documentation is output for doesEat and name public functions.
Actual outcome
{
"doesEat(string)": {
"author": "Bob Clampett",
"details": "Food must be provided in UTF-8 format",
"params": {
"_food": "The name of a food to evaluate (English)"
},
"return": "true if Bugs will eat it, false otherwise"
}
}
{
"doesEat(string)": {
"notice": "Determine if Bugs will or will not accept given food"
}
}
Follow on work
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
language design
Any changes to the language, e.g. new featuresAny changes to the language, e.g. new features