Intercoin / CommunityContract

Smart contract for managing community membership and roles
https://intercoin.org
GNU Affero General Public License v3.0
1 stars 2 forks source link

22 implement ownable interface with different semantics #30

Closed artman325 closed 1 year ago

artman325 commented 1 year ago

Please rename isAccountHasRole to hasRole, and all calls in our repos to it

Implement Ownable interface exactly as OpenZeppelin ABI suggests, but semantics are different:

owner() returns the first address in getAddresses(OWNERS_ROLE) isOwner(address) returns hasRole(address, OWNERS_ROLE) transferOwnership(address) will grantRoles([address], OWNERS_ROLE) and then revokeRoles(msg.caller, OWNERS_ROLE). > There is no need to have transferRole() function because normally no one can transfer their own roles unilaterally, except > owners. Instead they manage roles under them. The function renounceOwnership() will simply revokeRoles(getAddresses(OWNERS_ROLE), OWNERS_ROLE) from everyone > who has it, including the caller. This function is irreversible. The contract will be ownerless. The trackers should see the appropriate events/logs as from any Ownable interface.

Done