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 8c75188 commit 36fc240
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions marketMint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ contract Mint is ReentrancyGuard {
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
/*~~~>
Functions for retrieving memory items
Expand Down Expand Up @@ -245,7 +255,7 @@ contract Mint is ReentrancyGuard {
///@notice
/*~~~> External ETH transfer forwarded to role provider contract <~~~*/
receive() external payable {
payable(roleAdd).transfer(msg.value);
require(sendEther(roleAdd, msg.value));
}
function onERC1155Received(address, address, uint256, uint256, bytes memory) external virtual returns (bytes4) {
return this.onERC1155Received.selector;
Expand All @@ -258,4 +268,4 @@ contract Mint is ReentrancyGuard {
) external pure returns(bytes4) {
return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
}
}
}

0 comments on commit 36fc240

Please sign in to comment.