Skip to content

Commit

Permalink
Merge 7ca48ba into 789a7b6
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosio committed Dec 20, 2019
2 parents 789a7b6 + 7ca48ba commit b437f7d
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions contracts/Holdable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,21 @@ contract Holdable is IHoldable, ERC20 {
}

function executeHold(string memory operationId, uint256 value) public returns (bool) {
return _executeHold(operationId, value, false);
return _executeHold(
operationId,
value,
false,
true
);
}

function executeHoldAndKeepOpen(string memory operationId, uint256 value) public returns (bool) {
return _executeHold(operationId, value, true);
return _executeHold(
operationId,
value,
true,
true
);
}

function renewHold(string memory operationId, uint256 timeToExpiration) public returns (bool) {
Expand Down Expand Up @@ -287,7 +297,13 @@ contract Holdable is IHoldable, ERC20 {
return true;
}
function _executeHold(string memory operationId, uint256 value, bool keepOpenIfHoldHasBalance) internal returns (bool) {
function _executeHold(
string memory operationId,
uint256 value,
bool keepOpenIfHoldHasBalance,
bool doTransfer
) internal returns (bool)
{
Hold storage executableHold = holds[operationId.toHash()];
require(
Expand Down Expand Up @@ -315,7 +331,9 @@ contract Holdable is IHoldable, ERC20 {
);
}
_transfer(executableHold.origin, executableHold.target, value);
if (doTransfer) {
_transfer(executableHold.origin, executableHold.target, value);
}
return true;
}
Expand Down

0 comments on commit b437f7d

Please sign in to comment.