protecting against re-entrancy attack
This commit is contained in:
parent
b45e4b7952
commit
1d4682cd7c
|
@ -285,10 +285,9 @@ contract StandardBounty {
|
|||
onlyFulfiller(_milestoneId, _fulfillmentId)
|
||||
checkFulfillmentIsApprovedAndUnpaid(_milestoneId, _fulfillmentId)
|
||||
{
|
||||
fulfillments[_milestoneId][_fulfillmentId].fulfiller.transfer(fulfillmentAmounts[_milestoneId]);
|
||||
fulfillments[_milestoneId][_fulfillmentId].paid = true;
|
||||
|
||||
numPaid[_milestoneId]++;
|
||||
fulfillments[_milestoneId][_fulfillmentId].fulfiller.transfer(fulfillmentAmounts[_milestoneId]);
|
||||
|
||||
FulfillmentPaid(msg.sender, _milestoneId, _fulfillmentId);
|
||||
}
|
||||
|
@ -398,6 +397,15 @@ contract StandardBounty {
|
|||
{
|
||||
return fulfillments[_milestoneId].length;
|
||||
}
|
||||
/// @dev getNumMilestones() returns the number of milestones
|
||||
/// @return Returns the number of fulfillments
|
||||
function getNumMilestones()
|
||||
public
|
||||
constant
|
||||
returns (uint)
|
||||
{
|
||||
return fulfillmentAmounts.length;
|
||||
}
|
||||
|
||||
/// @dev unpaidAmount(): calculates the amount which
|
||||
/// the bounty has yet to pay out
|
||||
|
|
|
@ -87,11 +87,9 @@ contract TokenBounty is StandardBounty {
|
|||
onlyFulfiller(_milestoneId, _fulfillmentId)
|
||||
checkFulfillmentIsApprovedAndUnpaid(_milestoneId, _fulfillmentId)
|
||||
{
|
||||
tokenContract.transfer(fulfillments[_milestoneId][_fulfillmentId].fulfiller, fulfillmentAmounts[_milestoneId]);
|
||||
fulfillments[_milestoneId][_fulfillmentId].paid = true;
|
||||
|
||||
numPaid[_milestoneId]++;
|
||||
|
||||
tokenContract.transfer(fulfillments[_milestoneId][_fulfillmentId].fulfiller, fulfillmentAmounts[_milestoneId]);
|
||||
FulfillmentPaid(msg.sender, _milestoneId, _fulfillmentId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue