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:
- setup initial CostManager address
- fill renounceOverrideCostmanager address's list to prevent changing or override CoastManager in instances
- call overrideCostManager(instance, newCostManager) and override cost manager address in certain instance
in Instance:
- shoud be method overrideCostManager for factory owner(or instance deployer if instance was deployed manually) method should execute only if address instance not in renounceOverrideCostmanager list
- need to organize common method or by operation byte in first params or make bytes calldata and parse it in costmanager!!!
Summary: to change costmanager address can be changed only by owner factory
suggested methods for injecting Costmanager external calls:
| method to inject | params |
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
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:
Summary: to change costmanager address can be changed only by owner factory
suggested methods for injecting Costmanager external calls:
CommunityContract::grantRoles( address[] memory accounts, uint8[] memory rolesIndexes )CommunityContract::revokeRoles( address[] memory accounts, uint8[] memory rolesIndexes )CommunityContract::createRole( string memory role )CommunityContract::manageRole( uint8 byRole, uint8 ofRole, bool canGrantRole, bool canRevokeRole, uint8 requireRole, uint256 maxAddresses, uint64 duration )CommunityContract::invitePrepare( bytes memory sSig, bytes memory rSig )CommunityContract::inviteAccept( string memory p, bytes memory sSig, string memory rp, bytes memory rSig )CommunityContract::setTrustedForwarder( address forwarder )CommunityContract::setRoleURI( uint8 roleIndex, string memory roleURI )CommunityContract::setExtraURI( uint8 roleIndex, string memory extraURI )