Is it cheaper to store data across multiple instances of the same contract?

2

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.

Josh Beam

Posted 2015-12-11T21:11:23.237

Reputation: 121

Question was closed 2019-07-17T18:47:28.220

No answers