Skip to content

NTX4 - False Positive on function calling another state modifying function #35

@benber86

Description

@benber86

If I have an external method that does nothing but call another state-modifying internal method, natrix will trigger for NTX4.
Strangely it also triggers for the internal function which is more clearly modifying state.

/home/ben/Code/curve/fee_splitter_v2/src/GlobalFeeSplitter.vy:91:0 style NTX4: Function 'set_approval' reads contract state but is not marked as 'view'.

   90: @external
-> 91: def set_approval():
-> 92:     """
-> 93:     @notice Set infinite approval for fee distributor
-> 94:     @dev Only needs to be called once after deployment OR
-> 95:          if the fee collector's target token is changed
-> 96:     """
-> 97:     ownable._check_owner()
-> 98:     self._set_approval()
   99: 


/home/ben/Code/curve/fee_splitter_v2/src/GlobalFeeSplitter.vy:102:0 style NTX4: Function '_set_approval' reads contract state but is not marked as 'view'.

   101: @internal
-> 102: def _set_approval():
-> 103:     extcall fee_token.approve(
-> 104:         fee_distributor.address, max_value(uint256), default_return_value=True
-> 105:     )
   106: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions