Skip to content

Commit

Permalink
ACL: use TimeHelpers (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai committed Sep 3, 2018
1 parent e07c379 commit 7fca564
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions contracts/acl/ACL.sol
@@ -1,14 +1,15 @@
pragma solidity 0.4.24;

import "../apps/AragonApp.sol";
import "../common/TimeHelpers.sol";
import "./ACLSyntaxSugar.sol";
import "./IACL.sol";
import "./IACLOracle.sol";


/* solium-disable function-order */
// Allow public initialize() to be first
contract ACL is IACL, AragonApp, ACLHelpers {
contract ACL is IACL, TimeHelpers, AragonApp, ACLHelpers {
// Hardcoded constant to save gas
//bytes32 constant public CREATE_PERMISSIONS_ROLE = keccak256("CREATE_PERMISSIONS_ROLE");
bytes32 constant public CREATE_PERMISSIONS_ROLE = 0x0b719b33c83b8e5d300c521cb8b54ae9bd933996a14bef8c2f4e0285d2d2400a;
Expand Down Expand Up @@ -312,9 +313,9 @@ contract ACL is IACL, AragonApp, ACLHelpers {
value = checkOracle(IACLOracle(param.value), _who, _where, _what, _how) ? 1 : 0;
comparedTo = 1;
} else if (param.id == BLOCK_NUMBER_PARAM_ID) {
value = blockN();
value = getBlockNumber();
} else if (param.id == TIMESTAMP_PARAM_ID) {
value = time();
value = getTimestamp();
} else if (param.id == PARAM_VALUE_PARAM_ID) {
value = uint256(param.value);
} else {
Expand Down Expand Up @@ -432,8 +433,4 @@ contract ACL is IACL, AragonApp, ACLHelpers {
function permissionHash(address _who, address _where, bytes32 _what) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("PERMISSION", _who, _where, _what));
}

function time() internal view returns (uint64) { return uint64(block.timestamp); } // solium-disable-line security/no-block-members

function blockN() internal view returns (uint256) { return block.number; }
}

0 comments on commit 7fca564

Please sign in to comment.