limitfunds and fixes
This commit is contained in:
@ -13,9 +13,7 @@ contract Bounty is PullPaymentCapable {
|
|||||||
mapping(address => address) public researchers;
|
mapping(address => address) public researchers;
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
if (claimed) {
|
if (claimed) throw;
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTarget() returns(Token) {
|
function createTarget() returns(Token) {
|
||||||
@ -26,9 +24,7 @@ contract Bounty is PullPaymentCapable {
|
|||||||
|
|
||||||
function claim(Token target) {
|
function claim(Token target) {
|
||||||
address researcher = researchers[target];
|
address researcher = researchers[target];
|
||||||
if (researcher == 0) {
|
if (researcher == 0) throw;
|
||||||
throw;
|
|
||||||
}
|
|
||||||
// check Token contract invariants
|
// check Token contract invariants
|
||||||
if (target.totalSupply() == target.balance) {
|
if (target.totalSupply() == target.balance) {
|
||||||
throw;
|
throw;
|
||||||
|
|||||||
@ -4,12 +4,8 @@ contract GoodFailEarly {
|
|||||||
mapping(string => uint) nameToSalary;
|
mapping(string => uint) nameToSalary;
|
||||||
|
|
||||||
function getSalary(string name) constant returns (uint) {
|
function getSalary(string name) constant returns (uint) {
|
||||||
if (bytes(name).length == 0) {
|
if (bytes(name).length == 0) throw;
|
||||||
throw;
|
if (nameToSalary[name] == 0) throw;
|
||||||
}
|
|
||||||
if (nameToSalary[name] == 0) {
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nameToSalary[name];
|
return nameToSalary[name];
|
||||||
}
|
}
|
||||||
|
|||||||
11
contracts/LimitFunds.sol
Normal file
11
contracts/LimitFunds.sol
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
contract LimitFunds {
|
||||||
|
|
||||||
|
uint LIMIT = 5000;
|
||||||
|
|
||||||
|
function() { throw; }
|
||||||
|
|
||||||
|
function deposit() {
|
||||||
|
if (this.balance > LIMIT) throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,4 +2,5 @@ module.exports = function(deployer) {
|
|||||||
deployer.deploy(PullPaymentBid);
|
deployer.deploy(PullPaymentBid);
|
||||||
deployer.deploy(BadArrayUse);
|
deployer.deploy(BadArrayUse);
|
||||||
deployer.deploy(Bounty);
|
deployer.deploy(Bounty);
|
||||||
|
deployer.deploy(LimitFunds);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user