i want to deploy a simple token with buy function. function likes as follows;
function Buy()payable public returns(bool){
uint256 amount = msg.value*2/100;
_mint(msg.sender,amount);
_deposits[msg.sender] = _deposits[msg.sender] + msg.value;
return (true);
}
is it possible to have a button on my website to call this function. user enters the msg.value and clicks button, it connects web3 wallet ( binance smart chain) and make transfer. thank you in advance.