- 
                Notifications
    You must be signed in to change notification settings 
- Fork 50
Open
Labels
BugSomething isn't workingSomething isn't workingEnhancementNew feature or requestNew feature or requestSome DayThis issue may be worked on some day in the distant futureThis issue may be worked on some day in the distant future
Description
Certain authorization patterns, do not use a direct
require(msg.sender == owner);and instead perform a mapping-based authorization lookup that leads to the branch condition.
An example is provided below. This currently leads to violations for UnrestrictedWrite.
contract AuthTest {
    mapping(address => bool) isAuthorized;
    uint internal secret;
    constructor() public {
        isAuthorized[msg.sender] = true;
    }
    function setAuthorization(address a, bool v)
        public
        auth
    {
        isAuthorized[a] = v;
    }
    modifier auth {
        require(isAuthorized[msg.sender]);
        _;
    }
    function sensitiveFunc(uint x) public auth returns (bool) {
        secret = x;
    }
}Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingEnhancementNew feature or requestNew feature or requestSome DayThis issue may be worked on some day in the distant futureThis issue may be worked on some day in the distant future