You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spirit of having a separate <library name>-internals.ts is to give developers full control of the logic they want to implement.
For example, in the accessControl standard, the grantRole function is implemented and exported by accesControl.ts and assumes that only the owner of the contract can grant a new role. This is a bad practice as this assumes the logic that developers wish to implement. If some developer wants to implement a different logic, for example, if some application require that the accessControl be managed by an external contract, it would need to reimplement the grantRole method with a different logic. This is error prone and goes against the idea of defining a standard.
Thus, I suggest to backport the grantRole method to the accessControl-internals.ts and that this function doesn't assume any logic behind the fact of creating a new role. This internal function will then be wrapped into the implementation contract, with the logic required by the application.
The text was updated successfully, but these errors were encountered:
leoloco
changed the title
Remove logic from accessControl
Standardize accessControl
Mar 13, 2024
Context
The spirit of having a separate
<library name>-internals.ts
is to give developers full control of the logic they want to implement.For example, in the accessControl standard, the
grantRole
function is implemented and exported byaccesControl.ts
and assumes that only the owner of the contract can grant a new role. This is a bad practice as this assumes the logic that developers wish to implement. If some developer wants to implement a different logic, for example, if some application require that the accessControl be managed by an external contract, it would need to reimplement thegrantRole
method with a different logic. This is error prone and goes against the idea of defining a standard.Thus, I suggest to backport the
grantRole
method to theaccessControl-internals.ts
and that this function doesn't assume any logic behind the fact of creating a new role. This internal function will then be wrapped into the implementation contract, with the logic required by the application.The text was updated successfully, but these errors were encountered: