The maximum contract size is 24kb. I've built two versions of my contract, once than stores multiple classes of the same thing (ie. a proposal) using structs and one that is deployed for each of those classes. The first one saves lots of gas fees by using a single contract but is more hard to read and difficult to scale, the second is easier to read, and easier to scale but cost deployment gas fees everytime a new one is made. What is the industry standard in this scenario?

Jun 11, 2023, 3:10 PM
Would like to get ideas and just general advice on the way to go
Jun 11, 2023, 3:11 PM
I was asking the same thing yesterday
https://t.me/dev_solidity/1/252499
Jun 11, 2023, 3:21 PM
did you get any response?
Jun 11, 2023, 5:48 PM
Nope
Jun 11, 2023, 5:59 PM
do you deploy entire new contracts or clones?
Jun 11, 2023, 6:09 PM
1 contract that keeps track of (eg. multiple proposals) or deploy a new contract for every new proposal
The first is cheaper, the latter is much easier to scale and read
Jun 11, 2023, 6:10 PM
the second one
when you say new contract
you mean clones
Jun 11, 2023, 6:11 PM
Yes clones
Jun 11, 2023, 6:12 PM
or you deploy using the keyword "new"
Jun 11, 2023, 6:12 PM
Deploy using new
Jun 11, 2023, 6:12 PM
then they are not clones
check this
https://www.google.com/amp/blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract%3fhs_amp=true
Jun 11, 2023, 6:12 PM
Not trying to build a proxy, im asking for what the standards are when it comes to for instance using one contract for multiple escrows instead of a single one for each contract
One is cheaper the other is easier to read
The other one would deploy a new contract using "new", and the inbuilt ones would just store data for each escrow in a the form of an array or map
Jun 11, 2023, 6:17 PM
deploy each time a new contract like you are doing is not the right choice
if you want to have a clean view deploying a contract each gime use Clones as I said
Jun 11, 2023, 7:02 PM
Thanks, so by clone are you refering to proxies?
Jun 11, 2023, 7:04 PM
check the link I sent please
Jun 11, 2023, 7:12 PM

© 2024 Draquery.com All rights reserved.