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,100 points
584 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,790 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 aryya
• 7,460 points

edited Nov 13 by Khan Sarfaraz 504 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,740 points
690 views
+1 vote
1 answer
0 votes
0 answers
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,790 points
1,923 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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
• 69,220 points
1,464 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 25, 2018 in Blockchain by Christine
• 15,790 points
7,411 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,790 points

edited Mar 26, 2018 by Christine 1,567 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP