small bug fixes

This commit is contained in:
mbeylin 2017-05-29 14:39:44 -04:00
parent bbedecc843
commit e9d8589b8e
4 changed files with 30 additions and 5 deletions

View File

@ -6,6 +6,8 @@ import "./StandardBounty.sol";
/// @title Code bug bounties factory, concept by Stefan George - <stefan.george@consensys.net>
/// @author Gonçalo <goncalo.sa@consensys.net>
contract BountyFactory is Factory {
address[] public instances;
/// @dev Allows multiple creations of bounties
/// @param _deadline the unix timestamp after which fulfillments will no longer be accepted
@ -30,4 +32,5 @@ contract BountyFactory is Factory {
);
register(bounty);
}
}

View File

@ -49,21 +49,21 @@ contract CodeBugBounty is StandardBounty {
/// @dev CodeBugBounty(): instantiates a new draft code bug bounty
/// @param _deadline the unix timestamp after which fulfillments will no longer be accepted
/// @param _data the requirements of the bounty
/// @param _contactInfo the contact information of the issuer
/// @param _data the requirements of the bounty
/// @param _fulfillmentAmount the amount of wei to be paid out for each successful fulfillment
/// @param _bountiedContract the address of the contract to be bountied (with invariants check implemented)
function CodeBugBounty(
uint _deadline,
string _data,
string _contactInfo,
string _data,
uint _fulfillmentAmount,
Bountied _bountiedContract
)
StandardBounty(
_deadline,
_contactInfo,
_data,
_contactInfo,
_fulfillmentAmount
)
checkBountiedInvariants(_bountiedContract)

View File

@ -4,9 +4,12 @@ import "./CodeBugBounty.sol";
/// @title Code bug bounties factory, concept by Stefan George - <stefan.george@consensys.net>
/// @author Gonçalo <goncalo.sa@consensys.net>
/// @author Gonçalo <goncalo.sa@consensys.net>, Mark Beylin <mark.beylin@consensys.net>
contract CodeBugBountyFactory is Factory {
address[] public instances;
/// @dev Allows multiple creations of code bug bounties
/// @param _deadline the unix timestamp after which fulfillments will no longer be accepted
/// @param _data the requirements of the bounty
@ -30,6 +33,26 @@ contract CodeBugBountyFactory is Factory {
_fulfillmentAmount,
_bountiedContract
);
require (bugBounty!= 0x0);
register(bugBounty);
}
/// @dev Registers contract in factory registry.
/// @param instantiation Address of contract instantiation.
function register(address instantiation)
{
instances.push(instantiation);
isInstantiation[instantiation] = true;
instantiations[msg.sender].push(instantiation);
ContractInstantiation(msg.sender, instantiation);
}
/// @dev Returns number of instances
/// @return Returns number of instantiations by creator.
function getInstanceCount()
public
constant
returns (uint)
{
return instances.length;
}
}

View File

@ -9,7 +9,6 @@ contract Factory {
mapping(address => bool) public isInstantiation;
mapping(address => address[]) public instantiations;
address[] public instances;
/// @dev Returns number of instantiations by creator.
/// @param creator Contract creator.