Author

Topic: bep20 token web integration (Read 64 times)

newbie
Activity: 2
Merit: 1
June 29, 2021, 03:19:02 AM
#1
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.
Jump to: