Ethereum Advance token sample

0 votes

Here's a source code example: https://www.ethereum.org/token#full-coin-code

I have the following doubts here:

  • MyAdvanceToken - why the _transfer method is using > instead of >= for checking require(balanceOf[_from] > _value); while the TokenERC20 in this link is using >= ( require(balanceOf[_from] >=_value);)

  • Since inheritance will be in development only, the _transfer method base on this example is internal in TokenERC20, is it safe to assume that once deployed no one can use this internal function except from this contract ? There is no other contract that can inherit and use this internal method since inheritance is in development only?

Nov 2, 2018 in Blockchain by Perry
• 17,090 points
34 views

1 answer to this question.

0 votes
  1. Using > instead of >= is a typo and >= sign should be preferred over >. Imagine you have 15 tokens and want to send all of them - you'll not pass the require with > sign.

  2. It is safe because no one can use once deployed contract to inherit from. To create malignant inheritance you need to use parent contract code in the same or different file and deploy it one more time, creating the second base contract, distinct from the first one and not able to take its tokens.

answered Nov 2, 2018 by Christine
• 15,810 points

Related Questions In Blockchain

0 votes
1 answer

Ethereum Token Nam Redundancy

From my experience no, the trick is ...READ MORE

answered Jun 27, 2018 in Blockchain by ariaholic
• 7,340 points
38 views
0 votes
1 answer

How to avoid Ethereum Token Name redundancy?

I dont think you can do anything ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,600 points
36 views
0 votes
1 answer
+1 vote
1 answer

How to deploy ethereum smart contracts on a website?

There are many ways to do this: 1 ...READ MORE

answered Mar 26, 2018 in Blockchain by Johnathon
• 9,090 points
110 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
186 views
0 votes
1 answer
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 68,180 points
117 views
0 votes
1 answer

How to detect if an ethereum address is an ERC20 token contract?

There are many possible ways to achieve ...READ MORE

answered Sep 24, 2018 in Blockchain by Christine
• 15,810 points
313 views
0 votes
1 answer

How to make sure transactions take no fee in a private Ethereum blockchain?

In a private ethereum network you have ...READ MORE

answered Mar 26, 2018 in Blockchain by Christine
• 15,810 points

edited Mar 26, 2018 by Christine 145 views