Added natsec for all lifecycle contracts + bounty.sol, DayLimit.sol and LimitBalance.sol

This commit is contained in:
João Gabriel Carvalho
2017-04-25 19:16:02 -03:00
committed by maurelian
parent e851938199
commit b5d4120adb
7 changed files with 90 additions and 38 deletions

View File

@ -2,26 +2,32 @@ pragma solidity ^0.4.8;
/**
* LimitBalance
* Simple contract to limit the balance of child contract.
* Note this doesn't prevent other contracts to send funds
* by using selfdestruct(address);
* See: https://github.com/ConsenSys/smart-contract-best-practices#remember-that-ether-can-be-forcibly-sent-to-an-account
* @title LimitBalance
* @dev Simple contract to limit the balance of child contract.
* @dev Note this doesn't prevent other contracts to send funds by using selfdestruct(address);
* @dev See: https://github.com/ConsenSys/smart-contract-best-practices#remember-that-ether-can-be-forcibly-sent-to-an-account
*/
contract LimitBalance {
uint public limit;
/*
* @dev Constructor that sets the passed value as a limit
* @param _limit Uint to represent the limit.
*/
function LimitBalance(uint _limit) {
limit = _limit;
}
modifier limitedPayable() {
/*
* @dev Checks if limit was reached. Case true, it throws.
*/
modifier limitedPayable() {
if (this.balance > limit) {
throw;
}
_;
}
}