You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
538 B
27 lines
538 B
pragma solidity ^0.4.4;
|
|
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
contract LimitBalance {
|
|
|
|
uint public limit;
|
|
|
|
function LimitBalance(uint _limit) {
|
|
limit = _limit;
|
|
}
|
|
|
|
modifier limitedPayable() {
|
|
if (this.balance > limit) {
|
|
throw;
|
|
}
|
|
_;
|
|
|
|
}
|
|
|
|
}
|
|
|