protocol icon indicating copy to clipboard operation
protocol copied to clipboard

[OTHER] PropertyFactory should be used Clones.clone

Open aggre opened this issue 2 years ago • 1 comments

What would you like to share?

Clones.clone effectively reduces the waste of redeploying the "same implementation" by leveraging the Proxy pattern.

PropertyFactory.create contains Property.sol and it calls new each time it is executed. Therefore, it consumes a lot of gas fees.

Replacing the implementation of PropertyFactory.create with Clones.clone would require the following changes:

  • Deploy Property.sol as an implementation contract
  • PropertyFactory adds a setter such as setPropertyImpl(address impl) to store the address of the implementation contract
  • Increase the Solidity compiler for PropertyFactory to 0.8.x. (it needs to split the Truffle configuration file into two: https://ethereum.stackexchange.com/questions/73662/using-two-solc-versions-within-the-same-truffle-project)

Additional information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

aggre avatar Jun 10 '22 01:06 aggre

I've wrote the same issue on https://github.com/dev-protocol/protocol-v2/issues/373

aggre avatar Jun 10 '22 01:06 aggre