1

What is the correct approach to change the content of an inherited variable?
If contract A inherits contract B which has an variable b,
and contract A is initialising the inherited variable b through its constructor or one of its functions.
Should contract A then declare it as A.b = 123; or b = 123;

0

Both work. But I have never seen it used as A.b = 123;. I always use b = 123;.

| improve this answer | |
  • Isn't there something to the concern, related to copying / assigning and memory management/gas costs? – NowsyMe Aug 12 '18 at 22:03

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.