vendredi 9 octobre 2020

Struct Factories in Solidity

So I am working on a DApp in Solidity and would like to make use of Separation of Concerns. I have a Contract that adds and removes Users. My Users are of type Struct. So I thought I would write another contract, a UserFactory Contract utilising the Factory Design Pattern and separating the concerns since a UserManager should not be responsible for creating Users. Unfortunately I am unable to return Structs from my Factory Contract unless I enable ABIEncoderV2, but since this is an experimental feature it won't work in production. It seems that for Solidity I need to find a different approach to solve this design problem. Is there a go to approach for Solidity? Any help would be gladly appreciated. Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire