<aside> 🍶
Raise a Glass to Easy Chatting and Payments with Sake at Mantle⛓️
</aside>
Traditional chat apps face a number of issues that are resolved by Saké, an anonymous chat app with decentralized payment integration.
Some of our features are not available in mantle because of not availability of API - Moralis, so let’s look into the smart contracts that are deployed in the Mantle network
<aside> 🗒️ contract address: 0x26e08f59feb052a6124665e824456d78ff55f1fb
</aside>
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
contract payments{
function sendToken(IERC20 token, address payable _to, uint amount) external {
token.transferFrom(msg.sender, _to, amount);
}
function senEth(address payable _to) external payable {
(bool sent,) = _to.call{value: msg.value}("");
require(sent, "Failed to send Ether");
}
function SendsplitToken(address payable[] memory payees, uint amount, IERC20 token) external {
uint share = amount/payees.length;
for(uint i =0; i < payees.length;i++){
token.transferFrom(msg.sender, payees[i], share);
}
}
function SendsplitETH(address payable[] memory payees, uint amount) external payable {
require(amount == msg.value);
uint share = amount/payees.length;
for(uint i =0; i < payees.length;i++){
(bool sent,) = payees[i].call{value: share}("");
require(sent, "Failed to send Ether");
}
}
function SendNFTForPrice(address payable _from, IERC721 _nft, uint256 _tokenID, uint256 requestedMoney) external payable {
require(msg.value == requestedMoney);
require(_nft.ownerOf(_tokenID) == _from);
_nft.safeTransferFrom(_from, payable(msg.sender), _tokenID);
}
function SendNFT(address payable _to, IERC721 _nft, uint256 _tokenID) external payable {
require(_nft.ownerOf(_tokenID) == payable(msg.sender));
_nft.safeTransferFrom(payable(msg.sender), _to, _tokenID);
}
}
here is a Transaction of sending BIT through our contract in Mantle testnet

Users can start chatting by adding users through the search user bar at the left corner
Paste the address of the user to wish chat to and hit go.
The address will be displayed if the user exists
Click on the address and you can start chatting

To send erc20 tokens click on the dollar icon on the right bottom corner of the chat window
click on the token option from the pop-up window

select the token you wish to send from the token dropdown
enter the amount and check the equivalent dollar price by Chainlink
Add a note(optional) for reference
hit on send to transfer from your wallet or request it from the user

To send NFT click on the dollar icon on the right bottom corner of the chat window
click on the NFT option from the pop-up window