Skip to content

TMP: Pool roles module #3

@Evert0x

Description

@Evert0x

TMP-3: Pool roles


tmp: 3
title: Pool roles module
author: Evert Kors (@Evert0x)
discussions-to: #3
status: Draft
type: Module
created: 2021/01/09
requires (*optional):
replaces (*optional):


Simple Summary

Create an interface to support the following roles:

  • Member
  • Admin
  • Owner

Abstract

The following standard allows developers to easily integrate these standard roles.

Motivation

These roles are used in a lot of pool designs. This TMP will get everybody on the same page regarding usage.

Specification

Interface

interface IPoolRoles {

    function initializeRoles(address _owner) external;

    function isMember(address _account) external view returns (bool);

    function addMember(address _account) external;

    function removeMember(address _account) external;

    function isManager(address _account) external view returns (bool);

    function addManager(address _account) external;

    function removeManager(address _account) external;

    function isManagerRoleAdmin(address _account) external view returns (bool);

    function isMemberRoleAdmin(address _account) external view returns (bool);

    function getOwner() external view returns (address);

}
Internal Interface
interface IPoolRolesView {

    modifier onlyOwner();

    modifier onlyManager();

    modifier onlyMember();

    function _isMember(address _account) internal view returns (bool);

    function _isManager(address _account) internal view returns (bool);

    function _getOwner() internal view returns (address);
}
    

Storage

-

Rationale

Backwards Compatibility

Reference Implementation

https://github.com/Evert0x/MemberAccess
https://github.com/Evert0x/PoolRolesMock

Security Considerations

Copyright

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions