On Open Zeppelin's ERC20 BasicToken contract the variable totalSupply_
follows a naming convention I haven't seen before.
Is that to differentiate it from the function totalSupply()
below or is there another reason?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityOn Open Zeppelin's ERC20 BasicToken contract the variable totalSupply_
follows a naming convention I haven't seen before.
Is that to differentiate it from the function totalSupply()
below or is there another reason?
Yes that is precisely why.
If totalSupply_
was named totalSupply
it would clash with the function totalSupply()
and you would get the following error message:
DeclarationError: Identifier already declared.