I create a smart contract successfully using Remix IDE , Metamask and Ropsten for testing.
I want to sell some tokens using Sell
function, so I specified the value "20" for Sell function ,my initial balance was 600 after that I checked the balanceOf , the new value is 580,but my Ether Balance on Metamask didn't change.
My sell function code is :
function sell(uint amount)public returns (uint revenue){
require(balanceOf[msg.sender] >= amount);
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
revenue = amount / sellPrice;
msg.sender.transfer(revenue);
emit Transfer(msg.sender, this, amount);
result = amount;
return revenue;
}