[
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_roleManager",
                "type": "address"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "constructor"
    },
    {
        "inputs": [],
        "name": "InvalidInitialization",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NotInitializing",
        "type": "error"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint64",
                "name": "version",
                "type": "uint64"
            }
        ],
        "name": "Initialized",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "codeHash",
                "type": "bytes32"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "maxUses",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "expiryTime",
                "type": "uint256"
            }
        ],
        "name": "InviteCodeCreated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "codeHash",
                "type": "bytes32"
            }
        ],
        "name": "InviteCodeRevoked",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "member",
                "type": "address"
            }
        ],
        "name": "MemberJoined",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "member",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "enum ITribeController.MemberStatus",
                "name": "status",
                "type": "uint8"
            }
        ],
        "name": "MembershipUpdated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "requestId",
                "type": "uint256"
            }
        ],
        "name": "MergeApproved",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "requestId",
                "type": "uint256"
            }
        ],
        "name": "MergeCancelled",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "requestId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "sourceTribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "targetTribeId",
                "type": "uint256"
            }
        ],
        "name": "MergeExecuted",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "requestId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "sourceTribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "targetTribeId",
                "type": "uint256"
            }
        ],
        "name": "MergeRequested",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "enum ITribeController.JoinType",
                "name": "joinType",
                "type": "uint8"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "entryFee",
                "type": "uint256"
            }
        ],
        "name": "TribeConfigUpdated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "creator",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "string",
                "name": "tribeName",
                "type": "string"
            },
            {
                "indexed": false,
                "internalType": "enum ITribeController.JoinType",
                "name": "joinType",
                "type": "uint8"
            }
        ],
        "name": "TribeCreated",
        "type": "event"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "member",
                "type": "address"
            }
        ],
        "name": "approveMember",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "mergeRequestId",
                "type": "uint256"
            }
        ],
        "name": "approveMerge",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "member",
                "type": "address"
            }
        ],
        "name": "banMember",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "mergeRequestId",
                "type": "uint256"
            }
        ],
        "name": "cancelMerge",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "string",
                "name": "code",
                "type": "string"
            },
            {
                "internalType": "uint256",
                "name": "maxUses",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "expiryTime",
                "type": "uint256"
            }
        ],
        "name": "createInviteCode",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "string",
                "name": "name",
                "type": "string"
            },
            {
                "internalType": "string",
                "name": "metadata",
                "type": "string"
            },
            {
                "internalType": "address[]",
                "name": "admins",
                "type": "address[]"
            },
            {
                "internalType": "enum ITribeController.JoinType",
                "name": "joinType",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "entryFee",
                "type": "uint256"
            },
            {
                "components": [
                    {
                        "internalType": "address",
                        "name": "nftContract",
                        "type": "address"
                    },
                    {
                        "internalType": "enum ITribeController.NFTType",
                        "name": "nftType",
                        "type": "uint8"
                    },
                    {
                        "internalType": "bool",
                        "name": "isMandatory",
                        "type": "bool"
                    },
                    {
                        "internalType": "uint256",
                        "name": "minAmount",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256[]",
                        "name": "tokenIds",
                        "type": "uint256[]"
                    }
                ],
                "internalType": "struct ITribeController.NFTRequirement[]",
                "name": "nftRequirements",
                "type": "tuple[]"
            }
        ],
        "name": "createTribe",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "mergeRequestId",
                "type": "uint256"
            }
        ],
        "name": "executeMerge",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "offset",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "limit",
                "type": "uint256"
            }
        ],
        "name": "getAllTribes",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256[]",
                        "name": "tribeIds",
                        "type": "uint256[]"
                    },
                    {
                        "internalType": "uint256",
                        "name": "total",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct ITribeController.PaginatedTribes",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "string",
                "name": "code",
                "type": "string"
            }
        ],
        "name": "getInviteCodeStatus",
        "outputs": [
            {
                "internalType": "bool",
                "name": "valid",
                "type": "bool"
            },
            {
                "internalType": "uint256",
                "name": "remainingUses",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "getMemberCount",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "member",
                "type": "address"
            }
        ],
        "name": "getMemberStatus",
        "outputs": [
            {
                "internalType": "enum ITribeController.MemberStatus",
                "name": "",
                "type": "uint8"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "requestId",
                "type": "uint256"
            }
        ],
        "name": "getMergeRequest",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "sourceTribeId",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "targetTribeId",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "requestTime",
                        "type": "uint256"
                    },
                    {
                        "internalType": "bool",
                        "name": "approved",
                        "type": "bool"
                    }
                ],
                "internalType": "struct ITribeController.MergeRequest",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getTotalTribesCount",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "getTribeAdmin",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "getTribeConfigView",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "enum ITribeController.JoinType",
                        "name": "joinType",
                        "type": "uint8"
                    },
                    {
                        "internalType": "uint256",
                        "name": "entryFee",
                        "type": "uint256"
                    },
                    {
                        "components": [
                            {
                                "internalType": "address",
                                "name": "nftContract",
                                "type": "address"
                            },
                            {
                                "internalType": "enum ITribeController.NFTType",
                                "name": "nftType",
                                "type": "uint8"
                            },
                            {
                                "internalType": "bool",
                                "name": "isMandatory",
                                "type": "bool"
                            },
                            {
                                "internalType": "uint256",
                                "name": "minAmount",
                                "type": "uint256"
                            },
                            {
                                "internalType": "uint256[]",
                                "name": "tokenIds",
                                "type": "uint256[]"
                            }
                        ],
                        "internalType": "struct ITribeController.NFTRequirement[]",
                        "name": "nftRequirements",
                        "type": "tuple[]"
                    },
                    {
                        "internalType": "bool",
                        "name": "canMerge",
                        "type": "bool"
                    }
                ],
                "internalType": "struct ITribeController.TribeConfigView",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "getTribeDetails",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "id",
                        "type": "uint256"
                    },
                    {
                        "internalType": "string",
                        "name": "name",
                        "type": "string"
                    },
                    {
                        "internalType": "string",
                        "name": "metadata",
                        "type": "string"
                    },
                    {
                        "internalType": "address",
                        "name": "admin",
                        "type": "address"
                    },
                    {
                        "internalType": "enum ITribeController.JoinType",
                        "name": "joinType",
                        "type": "uint8"
                    },
                    {
                        "internalType": "uint256",
                        "name": "entryFee",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "memberCount",
                        "type": "uint256"
                    },
                    {
                        "internalType": "bool",
                        "name": "isActive",
                        "type": "bool"
                    },
                    {
                        "internalType": "bool",
                        "name": "canMerge",
                        "type": "bool"
                    }
                ],
                "internalType": "struct ITribeController.TribeDetails",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "getTribeWhitelist",
        "outputs": [
            {
                "internalType": "address[]",
                "name": "",
                "type": "address[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "user",
                "type": "address"
            }
        ],
        "name": "getUserTribes",
        "outputs": [
            {
                "internalType": "uint256[]",
                "name": "tribeIds",
                "type": "uint256[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            },
            {
                "internalType": "bytes32",
                "name": "",
                "type": "bytes32"
            }
        ],
        "name": "inviteCodes",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "user",
                "type": "address"
            }
        ],
        "name": "isAddressWhitelisted",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "name": "isMember",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "joinTribe",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "bytes32",
                "name": "inviteCode",
                "type": "bytes32"
            }
        ],
        "name": "joinTribeWithCode",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "nextMergeRequestId",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "nextTribeId",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "member",
                "type": "address"
            }
        ],
        "name": "rejectMember",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "sourceTribeId",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "targetTribeId",
                "type": "uint256"
            }
        ],
        "name": "requestMerge",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            }
        ],
        "name": "requestToJoinTribe",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "string",
                "name": "code",
                "type": "string"
            }
        ],
        "name": "revokeInviteCode",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "roleManager",
        "outputs": [
            {
                "internalType": "contract IRoleManager",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "string",
                "name": "newMetadata",
                "type": "string"
            },
            {
                "internalType": "address[]",
                "name": "updatedWhitelist",
                "type": "address[]"
            }
        ],
        "name": "updateTribe",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "tribeId",
                "type": "uint256"
            },
            {
                "internalType": "enum ITribeController.JoinType",
                "name": "joinType",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "entryFee",
                "type": "uint256"
            },
            {
                "components": [
                    {
                        "internalType": "address",
                        "name": "nftContract",
                        "type": "address"
                    },
                    {
                        "internalType": "enum ITribeController.NFTType",
                        "name": "nftType",
                        "type": "uint8"
                    },
                    {
                        "internalType": "bool",
                        "name": "isMandatory",
                        "type": "bool"
                    },
                    {
                        "internalType": "uint256",
                        "name": "minAmount",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256[]",
                        "name": "tokenIds",
                        "type": "uint256[]"
                    }
                ],
                "internalType": "struct ITribeController.NFTRequirement[]",
                "name": "nftRequirements",
                "type": "tuple[]"
            }
        ],
        "name": "updateTribeConfig",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    }
]
