-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Description
Some contracts need to have an account with special permissions. An example is MintableToken
, which has an address which is the only one allowed to mint tokens. These are currently implemented as Ownable
, with the special permissions assigned to the owner
(by marking some functions as onlyOwner
).
Sometimes a single contract has more than one feature requiring special permissions. Imagine a MintableToken
which is also a PausableToken
. In such a case, the contract owner can both mint tokens and pause the token.
This goes against the security principle of least privilege, and also makes some requirements harder to implement. As an example of the latter, suppose we have the requirement to disable minting after a crowdsale, but want to retain the ability to stop the contract in an emergency.
For the two reasons stated above, I believe we need to provide greater granularity of permissions. This is kind of doable under the current ownership framework, by setting as owner
a contract that can forward calls or not according to some logic. I don't dislike that, but I can see some problems with it.
We might want to provide the granularity directly, i.e. by making each privileged feature have a different address (or set of addresses) with permissions for it. At the same time it sounds like it could lead to an explosion of different permissions and roles which could be hard to manage.
Opening up the topic for discussion. Do you agree that permissions need to be more granular? Have you run into this problem yourself?