ether sending

This commit is contained in:
Alexey 2019-11-08 14:41:39 +03:00
parent bc8d0b20fc
commit e6cce0c7ce
3 changed files with 112 additions and 3 deletions

View file

@ -39,7 +39,7 @@ contract ERC20Mixer is Mixer {
_safeErc20Transfer(_relayer, _fee);
}
if (_refund > 0) {
_recipient.transfer(_refund);
_recipient.call.value(_refund)("");
}
}

View file

@ -31,9 +31,11 @@ contract ETHMixer is Mixer {
require(msg.value == 0, "Message value is supposed to be zero for ETH mixer");
require(_refund == 0, "Refund value is supposed to be zero for ETH mixer");
_recipient.transfer(denomination - _fee);
(bool success, ) = _recipient.call.value(denomination - _fee)("");
require(success, "payment to _recipient did not go thru");
if (_fee > 0) {
_relayer.transfer(_fee);
(success, ) = _relayer.call.value(_fee)("");
require(success, "payment to _relayer did not go thru");
}
}
}