I am making a blockchain project using solidity which requires storing various objectIDs corresponding to a personId. The person can add and remove objects and we cannot hard-code the number of objects. I am not being able to use the correct data structure for the same. I have looked for 2d arrays and nested mappings but am unable to figure out.

  • 2
    What have you tried? Please share some code to better illustrate what you are trying to do. Commented Dec 28, 2020 at 18:38
  • You can use nested mappings.
    – Ismael
    Commented Dec 30, 2020 at 1:36

1 Answer 1


I think you can make a struct and then create a mapping with it.

  • If you have a concrete example that will make your point more clear.
    – Ismael
    Commented Dec 30, 2020 at 0:55

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.