1

I've deployed a very simple Contract to Testnet. It has the following function...

function transfer(address _to, uint256 _value) public { /* Check if sender has balance and for overflows */ require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value >= balanceOf[_to]); /* Add and subtract new balances */ balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; /* Notify anyone listening that this transfer took place */ Transfer(msg.sender, _to, _value); } 

Question: Does the standard Ethereum wallet actually call onto this function when I use the wallet to send my token, e.g., with this code am I implementing an abstract function that is declared in some base Contract? If yes, where can I look at the base Contract declaration? If no, how does the standard Ethereum wallet know how to transfer my tokens? Thanks.

1 Answer 1

2

I'm not sure what you mean by "the standard Ethereum wallet," but no, there is no base contract that all contracts inherit from.

Tokens like this work by implementing a standard known as ERC20, which nearly all tools for viewing and transferring tokens understand and consume.

2
  • By that I meant the Ethereum wallet that is included in Mist and linked to for download from the Ethereum website. But I think I understand now. Thanks very much. Commented Dec 19, 2017 at 13:25
  • Ah, yes, I assume that Mist has built-in understanding/support for ERC20 tokens. Commented Dec 19, 2017 at 13:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.