Skip to content
Merged
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
9 changes: 5 additions & 4 deletions contracts/DecentralizedAutonomousTrust.sol
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ contract DecentralizedAutonomousTrust

/// @notice Confirms the transfer of `_quantityToInvest` currency to the contract.
function _collectInvestment(
address payable _from,
uint _quantityToInvest,
uint _msgValue,
bool _refundRemainder
Expand Down Expand Up @@ -350,7 +351,7 @@ contract DecentralizedAutonomousTrust
// currency is ERC20
require(_msgValue == 0, "DO_NOT_SEND_ETH");

currency.safeTransferFrom(msg.sender, address(this), _quantityToInvest);
currency.safeTransferFrom(_from, address(this), _quantityToInvest);
}
}

Expand Down Expand Up @@ -729,7 +730,7 @@ contract DecentralizedAutonomousTrust

emit Buy(msg.sender, _to, _currencyValue, tokenValue);

_collectInvestment(_currencyValue, msg.value, false);
_collectInvestment(msg.sender, _currencyValue, msg.value, false);

// Update state, initInvestors, and distribute the investment when appropriate
if(state == STATE_INIT)
Expand Down Expand Up @@ -942,7 +943,7 @@ contract DecentralizedAutonomousTrust
uint _currencyValue
) public payable
{
_collectInvestment(_currencyValue, msg.value, false);
_collectInvestment(msg.sender, _currencyValue, msg.value, false);
require(_currencyValue > 0, "MISSING_CURRENCY");
require(state == STATE_RUN, "INVALID_STATE");

Expand Down Expand Up @@ -1070,7 +1071,7 @@ contract DecentralizedAutonomousTrust
emit StateChange(state, STATE_CLOSE);
state = STATE_CLOSE;

_collectInvestment(exitFee, msg.value, true);
_collectInvestment(msg.sender, exitFee, msg.value, true);
}
else
{
Expand Down