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?
Add a comment
|
1 Answer
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.
-
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.– NowsyMeCommented May 25, 2018 at 13:44
-