i wanted to move token from one account to the other but the transaction is pending, what should i do?

 pragma solidity ^0.4.24;

contract smart{
event TransformToken(
    address _source,
    address _destination,
    uint amount
mapping (address => uint)account;

function showToken(address _address)public view returns(uint){
 uint token=account[_address];
 return (token);

function addToken(address _address,uint amount)public{
 function subToken(address _address,uint amount)public{

 function transfer(address _address,uint amount)public view returns(uint){
   emit TransformToken(msg.sender,_address,amount);
   return showToken(_address);

token pendding

  • Well your transfer function is useless here, as it is a view. It will not save anything to contract and won't emit events, so TransformToken event will not be fired, addToken and subToken functions will not increase actual values in contract storage.
    – Maxpeinas
    Sep 25, 2018 at 13:52

1 Answer 1


you are declaring transfer as a view function, this prevents it from altering state. It should work if you remove the view modifier.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.