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

Event tracking doesn't handle references #148

Open
dddejan opened this issue Jul 9, 2020 · 0 comments
Open

Event tracking doesn't handle references #148

dddejan opened this issue Jul 9, 2020 · 0 comments
Labels
bug Something isn't working events

Comments

@dddejan
Copy link
Member

dddejan commented Jul 9, 2020

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.

@dddejan dddejan added bug Something isn't working events labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working events
Projects
None yet
Development

No branches or pull requests

1 participant