Skip to main content

Controller

Controller contract use for the governance, manage members/groups, voting and proposal creation permissions.

Methods​

initialize​

function initialize(address tokenAddr) public initializer

Intialize the Muto Token (ERC20).

Parameters​

NameTypeDescription
_0addressundefined

_authorizeUpgrade​

function _authorizeUpgrade(address) internal override onlyOwner {}

Upgrade the controller contract.

Parameters​

NameTypeDescription
_0addressundefined

activate​

function activate() external onlyInitializing

Activate the controller state changes.

deactivate​

function deactivate() external

Deactivate the controller state changes.

setVotingContractAddress​

function setVotingContractAddress(address votingContractAddr) external onlyOwner

Set the voting contract address.

Parameters​

NameTypeDescription
_0addressundefined

assertVotingContractAddr​

function assertVotingContractAddr() internal returns(bool)

Assert voting contract address.

Returns​

NameTypeDescription
_0boolundefined

fetchAssertCommunity​

function fetchAssertCommunity(uint256 id, string memory errorMsg) internal view returns (Community storage)

Assert community.

Parameters​

NameTypeDescription
_0uint256undefined
_1stringundefined

Returns​

NameTypeDescription
_0Communityundefined

fetchCommunity​

function fetchCommunity(uint256 id) internal view returns (Community storage)

Retrieve data for target community if it exists. Used internally by various calls to validate community status, permissions, etc.

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0Communityundefined

setControllerProxy​

function setControllerProxy(address target) internal initializer returns (bool)

Set the proxy contract address which will call this contract. Can only be set once during contract initialization.

Parameters​

NameTypeDescription
policy_addressundefined

Returns​

NameTypeDescription
_0boolundefined

communityGroupsDetail​

function communityGroupsDetail(uint256 daoId) public view returns(Group[] memory group)

Check groups details of the particular community DAO

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0Groupundefined

communityDetail​

function communityDetail(uint256 daoId) public view returns(Community memory)

Create group of community and return array of id of the group.

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0Communityundefined

communityCreate​

function communityCreate(string memory name, string memory purpose, string memory legalStatus, string memory legalDocuments, string[] memory links, Group[] memory group, string memory logoImage, string memory coverImage) external onlyProxy returns (bool)

Create a Freedom MetaDAO Community using the provided parameters. Caller becomes the first member and admin automatically if the action succeeds.

Parameters​

NameTypeDescription
_0stringundefined
_1stringundefined
_2stringundefined
_3stringundefined
_4string[]undefined
_6Group[]undefined
_7stringundefined
_8stringundefined

Returns​

NameTypeDescription
_0boolundefined

transferBounty​

function transferBounty(uint256 _amount, address _targetAcc, uint256 commId) external onlyProxy returns (bool)

Transfer a bounty

Parameters​

NameTypeDescription
_0uint256undefined
_1addressundefined
_2uint256undefined

Returns​

NameTypeDescription
_0boolundefined

depositAmount​

function depositAmount(uint _amount, uint256 commId) external onlyProxy returns (bool)

Deposit amount to community

Parameters​

NameTypeDescription
_0uintundefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

changeName​

function changeName(string memory proposedDaoName, uint256 commId) external onlyProxy returns (bool)

Change the community name with proposed community name.

Parameters​

NameTypeDescription
_0stringundefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

changePurpose​

function changePurpose(string memory proposedPurpose, uint256 commId) external onlyProxy returns (bool)

Change the community purpose description with proposed community purpose description.

Parameters​

NameTypeDescription
_0stringundefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined
function changelinks(string[] memory links, uint256 commId) external onlyProxy returns (bool)

Change the community links with proposed links.

Parameters​

NameTypeDescription
_0string[]undefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

changeLogoNCoverImage​

function changeLogoNCoverImage(string memory logoImage, string memory coverImage, uint256 commId) external onlyProxy returns (bool)

Change the community logo and cover with proposed logo and cover.

Parameters​

NameTypeDescription
_0stringundefined
_1stringundefined
_2uint256undefined

Returns​

NameTypeDescription
_0boolundefined

changeLegalStatusNDoc​

function changeLegalStatusNDoc(string memory legalStatus, string memory legalDocuments, uint256 commId) external onlyProxy returns (bool)

change the community legal status with proposed legal status.

Parameters​

NameTypeDescription
_0stringundefined
_1stringundefined
_2uint256undefined

Returns​

NameTypeDescription
_0boolundefined

addMemberToGroup​

function addMemberToGroup(address addr, uint256 groupId, uint256 commId) external onlyProxy returns

Add member to group - internal function

Parameters​

NameTypeDescription
_0addressundefined
_1uint256undefined
_2uint256undefined

removeMemberToGroup​

function removeMemberToGroup(address addr, uint256 groupId, uint256 commId) external onlyProxy returns (bool)

Remove member from group - internal function

Parameters​

NameTypeDescription
_0addressundefined
_1uint256undefined
_2uint256undefined

Returns​

NameTypeDescription
_0boolundefined

createGroup​

function createGroup(Group memory newGroup, uint256 commId) external onlyProxy returns (bool)

Create group of a community.

Parameters​

NameTypeDescription
_0Groupundefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

isMemberOfCommunity​

function isMemberOfCommunity(uint256 commId, address senderAddr) internal view returns (MemberOfCommRes memory)

Check if is it a member of that community.

Parameters​

NameTypeDescription
_0uint256undefined
_1addressundefined

Returns​

NameTypeDescription
_0MemberOfCommResundefined

proposalCreationRight​

function proposalCreationRight(uint256 _type, uint256 commId, address senderAddr) external view returns (bool)

Do member have proposal creation rights.

Parameters​

NameTypeDescription
_0uint256undefined
_1uint256undefined
_1addressundefined

Returns​

NameTypeDescription
_0boolundefined

votingRight​

function votingRight(uint256 _type, uint256 commId, address senderAddr) external view returns (bool)

Do member have voting rights on proposal.

Parameters​

NameTypeDescription
_0uint256undefined
_1uint256undefined
_1addressundefined

Returns​

NameTypeDescription
_0boolundefined

Events​

EvtCommunityCreate​

event EvtCommunityCreate( uint256 id, uint256[] groupIds);

Parameters​

NameTypeDescription
_0uint256undefined
_1uint256undefined

EvtCommunitySuspend​

event EvtCommunitySuspend( string reason )

Parameters​

NameTypeDescription
_0stringundefined

EvtCommunityUnsuspend​

event EvtCommunityUnsuspend( string reason )

Parameters​

NameTypeDescription
_0stringundefined

EvtCreateGroup​

event EvtCreateGroup( uint256 groupId );

Parameters​

NameTypeDescription
_0uint256undefined