Skip to content

Commit

Permalink
transfer eth function
Browse files Browse the repository at this point in the history
  • Loading branch information
StarKeyJON authored Mar 31, 2022
1 parent 36fc240 commit 8c3eaef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions MarketOffers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,16 @@ function transferFromERC721(address assetAddr, uint256 tokenId, address to) inte
return true;
}

/// @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
/*~~~>
Calculating the platform fee,
Expand Down Expand Up @@ -645,7 +655,7 @@ function transferFromERC721(address assetAddr, uint256 tokenId, address to) inte
/*~~~> 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);
}
}
}

0 comments on commit 8c3eaef

Please sign in to comment.