diff --git a/contracts/StatusMap.sol b/contracts/StatusMap.sol index 1cdf8bb..d3fecb1 100644 --- a/contracts/StatusMap.sol +++ b/contracts/StatusMap.sol @@ -27,7 +27,7 @@ contract StatusMap { /** * @dev Sets the bit at `index` to the boolean `value` for the account `account`. */ - function _overwriteStatusTo(address account, uint256 index, bool value) internal { + function _overwriteStatusTo(address account, uint8 index, bool value) internal { if (value) { _assignStatus(account, index); } else { @@ -52,7 +52,7 @@ contract StatusMap { /** * @dev Sets the bit at `index` to 1 for the account `account`. */ - function _assignStatus(address account, uint256 index) internal { + function _assignStatus(address account, uint8 index) internal { uint256 mask = 1 << (index); statusesByAccount[account] |= mask; } @@ -67,7 +67,7 @@ contract StatusMap { /** * @dev Sets the bit at `index` to 0 for the account `account`. */ - function _unassignStatus(address account, uint256 index) internal { + function _unassignStatus(address account, uint8 index) internal { uint256 mask = 1 << index; statusesByAccount[account] &= ~mask; } diff --git a/contracts/mock/MockStatusMap.sol b/contracts/mock/MockStatusMap.sol index 6cd7400..d7b4ca8 100644 --- a/contracts/mock/MockStatusMap.sol +++ b/contracts/mock/MockStatusMap.sol @@ -12,7 +12,7 @@ contract MockStatusMap is StatusMap { return _areStatusesSet(account, mask); } - function overwriteStatusTo(address account, uint256 index, bool value) public { + function overwriteStatusTo(address account, uint8 index, bool value) public { _overwriteStatusTo(account, index, value); } @@ -20,11 +20,11 @@ contract MockStatusMap is StatusMap { _assignMultipleStatuses(account, indicesMask); } - function assignStatus(address account, uint256 index) public { + function assignStatus(address account, uint8 index) public { _assignStatus(account, index); } - function unassignStatus(address account, uint256 index) public { + function unassignStatus(address account, uint8 index) public { _unassignStatus(account, index); } }