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

CostManager injection #19

Open artman325 opened 2 years ago

artman325 commented 2 years ago

implement "CostManager functionalty" main goal are make the hook for couple of methods in factory and produced instance to make additional management mechanism

Requirements: factory can:

in Instance:

suggested methods for injecting Costmanager external calls:

method to injectparams
CommunityFactory:produce(
address hook, 
string memory name, 
string memory symbol
)
address hook, 
string memory name, 
string memory symbol
CommunityContract::withdrawRemainingBalance
uin256 balance
CommunityContract::grantRoles(
        address[] memory accounts, 
        uint8[] memory rolesIndexes
    )
address[] memory accounts, 
uint8[] memory rolesIndexes
CommunityContract::revokeRoles(
        address[] memory accounts, 
        uint8[] memory rolesIndexes
    ) 
address[] memory accounts, 
uint8[] memory rolesIndexes
CommunityContract::createRole(
        string memory role
    ) 
string memory role
CommunityContract::manageRole(
        uint8 byRole, 
        uint8 ofRole, 
        bool canGrantRole, 
        bool canRevokeRole, 
        uint8 requireRole, 
        uint256 maxAddresses, 
        uint64 duration
    )
uint8 byRole, 
uint8 ofRole, 
bool canGrantRole, 
bool canRevokeRole, 
uint8 requireRole, 
uint256 maxAddresses, 
uint64 duration
CommunityContract::invitePrepare(
        bytes memory sSig, 
        bytes memory rSig
    ) 
no params
CommunityContract::inviteAccept(
        string memory p, 
        bytes memory sSig, 
        string memory rp, 
        bytes memory rSig
    )
address inviter,
address invited,
uint8[] roles
CommunityContract::setTrustedForwarder(
        address forwarder
    ) 
address forwarder
CommunityContract::setRoleURI(
        uint8 roleIndex,
        string memory roleURI
    ) 
uint8 roleIndex,
string memory roleURI
CommunityContract::setExtraURI(
        uint8 roleIndex,
        string memory extraURI
    )
uint8 roleIndex,
string memory extraURI

For all can be called costmanager hook

artman325 commented 2 years ago

@EGreg, please review and make comments if necessary