Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

ico buy function


     function buy ()   payable external    returns (bool){
         uint amounttoBuy =(msg.value*tokenQuantity)/1 ether;
         require(amounttoBuy<token.allowance(tokenOwner,address(this)),"Not Alloted Token to this Address");
         token.transferFrom(tokenOwner,msg.sender,amounttoBuy);
         return true;
     }
 
 
PREVIOUS NEXT
Tagged: #ico #buy #function
ADD COMMENT
Topic
Name
5+2 =