hats-finance / Kintsu-0x7d70f9442af3a9a0a734fa6a1b4857f25518e9d2

Smart contracts for Kintsu
Other
0 stars 0 forks source link

Having only one member per role might not be wanted #20

Open hats-bug-reporter[bot] opened 4 months ago

hats-bug-reporter[bot] commented 4 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0x10ec4039923d13d8e06d40e95594e1dce4b5e79de237137c13aef44878023ba8 Severity: low

Description: Description\ Currently in the registry contract, there is a system implementing roles for different tasks. These roles can have one admin and one account, where the admin can change both the account and the admin of a role. Since these roles play a big part in Kintsu, it might not be wanted to only have one account per role.

Recommendation\ I would recommend changing the struct Role in the registry from

pub struct Role {
    admin: AccountId,
    account: AccountId,
}

to:

pub struct Role {
    admin: AccountId,
    account: Vec<AccountId>,
}

Additionally the functions handling role transfers would need to be modified to allow for adding and removing members to the role.

With this the protocol would not rely on only one account to do possibly important tasks for the protocol.

0xmahdirostami commented 4 months ago

Thank you for your submission. design choice, there is no issue here.