Skip to content

Event tracking doesn't handle references #148

Description

@dddejan
pragma solidity >=0.5.0;

contract EventTrackingStorageRef {

  mapping(address=>bool) data;

  /// @notice tracks-changes-in data
  event e(address a);

  /// @notice emits e
  function f(address a) public {
    mapping(address=>bool) storage ref = data;
    ref[a] = true;
  }
}

In the contract above, function f should emit the event but it doesn't, this should be reported as error. Current version says

$ ./solc-verify.py issue.sol --output .
EventTrackingStorageRef::f: OK
EventTrackingStorageRef::[implicit_constructor]: OK
Use --show-warnings to see 1 warning.
No errors found.

We need to check if the reference potentially updates the tracked data which is currently not done.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingevents

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions