From what I understand, code is deduplicated on the Ethereum blockchain by storing pointers in new blocks to blocks containing code that is being reused in the new block.

If that's the case:

  1. Is it better to store a new instance of a contract for each set of data (for example, information about a user), or...
  2. better to have just one contract that stores all data in a data structure like an array of objects (for example, storing information about all users in one contract.

To clarify with some incorrect pseudo code, should I store my information like this?

contract Whatever {
  Users = [
   {}, {}, {}, {}

or like this:

// User 1
contract Whatever {}

// User 2
contract Whatever {}

// User 3
contract Whatever {}

// etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.