Anh
Anh

Reputation: 95

Deploy multiple smart contract vs reuse a single one?

Should I treat a smart contract as an instance or a reuseable service?

Example, for the application that allows users to play a game with other users and wager some coins.

Does each match deploy a new smart contract?

Or we deploy smart contract only once, call function and store data in an array ( given that match time is short), delete the data in the array when the match is done?

Upvotes: 1

Views: 639

Answers (1)

jhonny
jhonny

Reputation: 858

depending on what are you trying to do, some cases like libraries you can deploy one contract and use it in as many contracts you want, other libraries are imported and used directly like safemath, it depends on what you are trying to do and how you want to handle the trade off of each solution

Upvotes: 1

Related Questions