Commit b6a58300 by Makoto Inoue

Does not allow to create bounty contract without address

parent 95092986
......@@ -28,7 +28,12 @@ contract Bounty is PullPayment, Killable {
if (claimed) throw;
}
function Bounty(address _factoryAddress){
modifier withAddress(address _address) {
if(_address == 0) throw;
_;
}
function Bounty(address _factoryAddress) withAddress(_factoryAddress){
factoryAddress = _factoryAddress;
}
......
......@@ -2,7 +2,6 @@ module.exports = function(deployer) {
deployer.deploy(PullPaymentBid);
deployer.deploy(BadArrayUse);
deployer.deploy(ProofOfExistence);
deployer.deploy(Bounty);
deployer.deploy(CrowdsaleTokenBounty);
deployer.deploy(Ownable);
deployer.deploy(LimitFunds);
......
......@@ -33,6 +33,18 @@ contract('Bounty', function(accounts) {
then(done);
})
it("cannot create bounty without address", function(done){
var target = SecureTargetMock.deployed();
Bounty.new().
then(function(bounty){
throw {name : "NoThrowError", message : "should not come here"};
}).
catch(function(error){
assert.notEqual(error.name, "NoThrowError");
}).
then(done);
})
it("empties itself when killed", function(done){
var target = SecureTargetMock.deployed();
var owner = accounts[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment