A Factory is a contract that can:

  1. Clone a previously set model contract

  2. Correctly initialize that model contract with custom data

Why should you create a Factory?

By creating a Factory you allow users/developers/projects who are creating things on Ethereum, to clone the model contract of your Factory and use or integrate it in their Protocols/Dapp according to their customization needs.

You can also create a real business through the Factories. In fact, you can insert a fee-based business model being able to earn from users who use your Factory and/or the contracts cloned from the Factory itself. Look here for more information.

EthereansOS, through the swissknife library, provides the standardFactory contract that can be deployed, initialized, and used to clone the model contract set. Not being an abstract contract, it does not necessarily need to be integrated into a child contract. You can deploy it and use it as is.

However, to build more complex logic it is possible to integrate the Factory standard contract and the IFactory interface in your custom contract to build a Factory with custom and more complex functionalities.

It is possible for example to build a Factory able to clone multiple contracts in a single transaction, to create a Factory that integrates with the functioning of an Organization and automatically sets a Component to an Organization and, as said before, to create a Factory with a business model and economic logic.

Last updated