Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,13 @@ contract LenderCommitmentGroup_Smart is

//mint shares equal to _amount and give them to the shares recipient !!!
poolSharesToken.mint(_sharesRecipient, sharesAmount_);



// prepare current balance
uint256 sharesBalance = poolSharesToken.balanceOf(address(this));
_prepareSharesForWithdraw(sharesBalance);

//reset prepared amount
poolSharesPreparedToWithdrawForLender[msg.sender] = 0;

emit LenderAddedPrincipal(

Expand Down Expand Up @@ -506,11 +509,16 @@ contract LenderCommitmentGroup_Smart is
function prepareSharesForWithdraw(
uint256 _amountPoolSharesTokens
) external returns (bool) {
return _prepareSharesForWithdraw(_amountPoolSharesTokens);
}

function _prepareSharesForWithdraw(
uint256 _amountPoolSharesTokens
) internal returns (bool) {
require( poolSharesToken.balanceOf(msg.sender) >= _amountPoolSharesTokens );

poolSharesPreparedToWithdrawForLender[msg.sender] = _amountPoolSharesTokens;
poolSharesPreparedTimestamp[msg.sender] = block.timestamp;

poolSharesPreparedTimestamp[msg.sender] = block.timestamp;

return true;
}
Expand All @@ -530,7 +538,7 @@ contract LenderCommitmentGroup_Smart is


poolSharesPreparedToWithdrawForLender[msg.sender] = 0;
poolSharesPreparedTimestamp[msg.sender] = 0;
poolSharesPreparedTimestamp[msg.sender] = block.timestamp;


//this should compute BEFORE shares burn
Expand Down