e.g; With the receive() function in the BEP20 network, I capture when a money is transferred and trade with a script. But when other tokens such as WBNB, USDT are sent, I cannot do anything.
What I want to do: convert all coins and tokens directly transferred to the contract to busd via receive or fallback (or whichever works with) pancakeswap and mapping(address => uint) balance;
I want to import the MAP into it.
I searched a lot but couldn't find the result I was looking for.
Could you please share which is the required source code for this process?
I using this function:
contract SendMoney{
mapping(address => uint) balance;
receive() external payable {
SendedMoney(msg.sender, msg.value);
}
function SendedMoney(address _senderaddress, uint _amount){
balance[_senderaddress] = _amount;
}
}