vyper
vyper copied to clipboard
NatSpec parsing bug: `userdoc` and `devdoc` ignore `__init__` comments
Example to Reproduce
Vyper version 0.4.0b6+commit.e34ca9ca used. Use the modules branch of snekmate contracts and invoke
vyper src/snekmate/governance/mocks/TimelockControllerMock.vy -f devdoc,userdoc
which will produce:
{"title": "TimelockController Module Reference Implementation", "custom:contract-name": "TimelockControllerMock", "license": "GNU Affero General Public License v3.0 only", "author": "pcaversaccio"}
But it completely ignores my NatSpec comments in the __init__ function (see here):
@deploy
@payable
def __init__(minimum_delay_: uint256, proposers_: DynArray[address, tc._DYNARRAY_BOUND], executors_: DynArray[address, tc._DYNARRAY_BOUND], admin_: address):
"""
@dev Initialises the contract with the following parameters:
- `minimum_delay_`: The initial minimum delay in seconds
for operations,
- `proposers_`: The accounts to be granted proposer and
canceller roles,
- `executors_`: The accounts to be granted executor role,
- `admin_`: The optional account to be granted admin role
(disable with the zero address).
IMPORTANT: The optional admin can aid with initial
configuration of roles after deployment without being
subject to delay, but this role should be subsequently
renounced in favor of administration through timelocked
proposals.
To omit the opcodes for checking the `msg.value`
in the creation-time EVM bytecode, the constructor
is declared as `payable`.
@param minimum_delay_ The 32-byte minimum delay in seconds
for operations.
@param proposers_ The 20-byte array of accounts to be granted
proposer and canceller roles.
@param executors_ The 20-byte array of accounts to be granted
executor role.
@param admin_ The 20-byte (optional) account to be granted admin
role.
"""
# The following line assigns the `DEFAULT_ADMIN_ROLE`
# to the `msg.sender`.
ac.__init__()
tc.__init__(minimum_delay_, proposers_, executors_, admin_)