Bitcoin Forum

Alternate cryptocurrencies => Service Discussion (Altcoins) => Topic started by: DonateToken on June 29, 2021, 08:19:02 AM



Title: bep20 token web integration
Post by: DonateToken on June 29, 2021, 08:19:02 AM
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.