Search code examples
blockchainethereumsmartcontractsremix

Tansaction cost issue in Either one smart contract or multiple contract?


Recently I made a block-chain (ethereum) application using Nodejs , express ,Solc. where I have a owner, renter and some Object to be renter. My concern is either should i make one universal smart contract using for all the attributes or should i make a 3 contracts individually.

As i have observed in remix IDE the total transaction cost in 3 contract is lower than the one contract.

Can you please suggest which is a better option?


Solution

  • You have to choose an option which works. I would always separate contracts when I can. Just because it's blockchain and deployed contract cannot be changed later. Imagine the situation when you made a mistake in one contract but deployed all 3 as one. You will need to redeploy all your contracts which is disaster. And finally as you said, 3 contracts are even cheaper, so why are you still asking? ;)

    Basically it's like uniting 3 web application into one monolith application vs having couple of services. My experience in web tells that services wins :)