DayLimit
contract DayLimit
Base contract that enables methods to be protected by placing a linear limit (specifiable) on a particular resource per calendar day. Is multiowned to allow the limit to be altered.
Source: DayLimit.sol
Reference
Modifiers
limitedDaily
modifier limitedDaily(uint256 _value)
Simple modifier for daily limit.
- Parameters:
_value
- uint256
Functions
DayLimit
function DayLimit(uint256 _limit) public
Constructor that sets the passed value as a dailyLimit.
- Parameters:
_limit
- uint256 to represent the daily limit.
_resetSpentToday
function _resetSpentToday() internal
Resets the amount already spent today.
_setDailyLimit
function _setDailyLimit(uint256 _newLimit) internal
Sets the daily limit. Does not alter the amount already spent today.
- Parameters:
_newLimit
- uint256 to represent the new limit.
underLimit
function underLimit(uint256 _value) internal returns (bool)
Checks to see if there is enough resource to spend today. If true, the resource may be expended.
- Parameters:
_value
- uint256 representing the amount of resource to spend.- Returns:
- A boolean that is True if the resource was spent and false otherwise.