From 4cafbb913e128edc11ecdb6a43bef4fb1823679a Mon Sep 17 00:00:00 2001 From: "phunkyjon.eth" <83514596+StarKeyJON@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:56:26 -0400 Subject: [PATCH] transer eth function added --- MarketTrades.sol | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/MarketTrades.sol b/MarketTrades.sol index 9b91ff3..28c85ab 100644 --- a/MarketTrades.sol +++ b/MarketTrades.sol @@ -773,11 +773,21 @@ contract MarketTrades is ReentrancyGuard { } } + /// @notice + /*~~~> + Internal function for sending ether + <~~~*/ + /// @return Bool + function sendEther(address recipient, uint ethvalue) internal nonReentrant returns (bool){ + (bool success, bytes memory data) = address(recipient).call{value: ethvalue}(""); + return(success); + } + ///@notice /*~~~> External ETH transfer forwarded to role provider contract <~~~*/ event FundsForwarded(uint value, address from, address to); receive() external payable { - payable(roleAdd).transfer(msg.value); + require(sendEther(roleAdd, msg.value)); emit FundsForwarded(msg.value, msg.sender, roleAdd); } @@ -793,4 +803,4 @@ contract MarketTrades is ReentrancyGuard { )external pure returns(bytes4) { return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")); } -} \ No newline at end of file +}