arc
arc copied to clipboard
Universal schemes can be better defined
Non-universal schemes modules should not be located in the universalSchemes folder. I believe DaoCreator is currently the only one.
I'm not clear why OrganizationRegister should be defined as universal. It doesn't call any controller methods that require it to be.
I think this begs a better definition in the Arc documentation of what "Universal Scheme" really means. I'm not sure the existing docs are clear enough on this. Just saying that a universal scheme implements a particular interface (that itself seems meaningless, doesn't include getParametersFromController as an explanation for what the interface means) does not say enough about such an important concept as a universal scheme.
I think the definition of "Universal" tends to be that the code can be used in the context of any Arc-style DAO (ie, a DAO that has an Arc-style controller).
Indeed the only distinguishing feature I can find of universal schemes is that they are allowed to call certain methods on an Arc controller. This may be their defining quality, I suggest we document it more clearly, and describe why that capability is important to a DAO in the DAOstack ecosystem, and why that makes them "Universal".
So following that, I suggest we be clear about the other "schemes" that don't have this capability, and don't need it, yet are still called "universal schemes".
Schemes are called "Universal" is a sense that they are not related to a single specific DAO(controller) and can be used and registered as a functional scheme for/by any DAO(controller). OrganizationRegister falls under this definition as well.
@leviadam @orenyodfat
Schemes are called "Universal" is a sense that they are not related to a single specific DAO(controller) and can be used and registered as a functional scheme for/by any DAO(controller).
To clarify the answer to this:
So-called non-universal schemes can also be registered with a DAO, for example Auction4Reputation. So while being registered with a DAO gives permissions to the scheme to use the controller, it does not make the scheme "universal".
I find that the only distinguishing characteristic of a universal scheme is that it has a one-to-one mapping betwen a set of parameters and a controller, where the parameters are registered against (are stored by) a given controller as a hash that the scheme is able to obtain and unpack.
This is what UniversalSchemeInterface is trying to express, but I feel like the interface can do a better job of it. The only public aspect of that interface is the function updateParameters that is ownerOnly and is in fact never used anywhere in the Arc codebase, so would seem to have nothing to do with schemes, and would therefore seem likely to be removed. This seems like a rather awkward way to define a universal scheme to the world.
So I would consider adding a property isUniversal that simply returns a constant true. This would unequivocally identify any contract, whether from Arc or not, as being universal and therefore supporting the ability to get and set parameters as the Arc universal schemes do.
I would also suggest that getParametersFromController be made public (because it is a useful function for clients of Arc) and that updateParameters be removed entirely or else be justified somehow by comments in the code.