title: solidity transaction error, The called function should be payable if you send value and the value you send should be less than your current balance
body: <p>I'm learning solidity on remix.
  I was following some tutorial video on youtube and I've got stuck trying to build 2 contracts.
  contract ERC20Token has function which increases balances. And Mycontract instantiates and call the mint function. I did it the same way as the guy on youtube did, but I ran into error saying when I call buyToken function. The error is saying</p>
  <blockquote>
  <p>transact to MyContract.buyToken errored: VM error: revert.</p>
  <p>revert    The transaction has been reverted to the initial state.</p>
  <p>Note: The called function should be payable if you send value and the value you send should be less than your current balance.    Debug the transaction to get more information.</p>
  </blockquote>
  <p>Please help me out.</p>
  <p>Here is the code.</p>
  <pre><code>pragma solidity 0.5.1;
  
  contract ERC20Token{
     string public name;
     mapping(address =&gt; uint256) public balances;
  
     function mint() public {
         balances[tx.origin] ++;
    }
  }
  
  contract MyContract {
     address payable wallet;
     address public token;
  
  
     constructor(address payable _wallet, address _token) public {
      wallet = _wallet;
      token = _token;
  }
  
      
  
     function buyToken() public payable {
         ERC20Token _token = ERC20Token(address(token)); 
         _token.mint();
         wallet.transfer(msg.value);
      
        }
    }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/Erl6k.jpg" alt="enter image description here" /></p>