diff --git a/contracts/StatusContribution.sol b/contracts/StatusContribution.sol index 3348dc4..7ac1909 100644 --- a/contracts/StatusContribution.sol +++ b/contracts/StatusContribution.sol @@ -219,11 +219,11 @@ contract StatusContribution is Owned, TokenController { } function buyGuaranteed(address _th) internal { - uint256 toFund; - uint256 cap = guaranteedBuyersLimit[_th]; + uint256 toCollect = guaranteedBuyersLimit[_th]; - if (guaranteedBuyersBought[_th].add(msg.value) > cap) { - toFund = cap.sub(guaranteedBuyersBought[_th]); + uint256 toFund; + if (guaranteedBuyersBought[_th].add(msg.value) > toCollect) { + toFund = toCollect.sub(guaranteedBuyersBought[_th]); } else { toFund = msg.value; }