0

When I call a function from a child contract which has been generated through a parent contract, then the mapping within the parent contract which consist of information related to the child contract (various global state variables such as name, etc.) does not update its content.
However, the global state variables are updated in the child contract when called.

What could be the issue in terms of the mapping not updating. should I have any mapping updating logic defined within the called child function?

1 Answer 1

-2

You shouldn't replicate the information already in the child contract inside the parent one. What you can keep is the address of the child contract (its instance) and call its functions to get the information stored inside the child contract and process it for your purpose.

Having information duplicated in the contracts might cause redundancy (an, as per your case) mismatch.

2
  • No information is duplicated, what makes you say that? I'm trying to update the information of a mapping in the parent contract, when I change the related global state variables in the child contract.
    – NowsyMe
    Commented May 25, 2018 at 13:44
  • It's not too clear to me, just post your code then.
    – qbsp
    Commented May 25, 2018 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.