diff --git a/package-lock.json b/package-lock.json index 3c1bbb54..c6f023c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "moment-timezone": "^0.5.38", "next": "^14.2.18", "next-router-mock": "^0.9.9", - "oci-js-sdk": "^1.6.0", + "oci-js-sdk": "^1.6.1", "papaparse": "^5.4.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -21268,9 +21268,9 @@ "license": "MIT" }, "node_modules/oci-js-sdk": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/oci-js-sdk/-/oci-js-sdk-1.6.0.tgz", - "integrity": "sha512-wYC2l85sqZ7qPOeKnMQhtJ8tk5t4N/DPuCh9CwA4EQTgkn5jc6feRXgQnQsaRhK7a+IuKYkBKGemVVoOOuQofg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/oci-js-sdk/-/oci-js-sdk-1.6.1.tgz", + "integrity": "sha512-SJCjGutEo0mgXsQ1w9NSww7xWiMQ5ZOQsor9ufUBC6NjExxk3Yb8etd6MNMWoa1InISpxhNtu/REIEFwBeK1Yg==", "license": "ISC", "dependencies": { "@ethereum-attestation-service/eas-sdk": "^2.7.0", diff --git a/package.json b/package.json index b050d67e..5559f2fb 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "moment-timezone": "^0.5.38", "next": "^14.2.18", "next-router-mock": "^0.9.9", - "oci-js-sdk": "^1.6.0", + "oci-js-sdk": "^1.6.1", "papaparse": "^5.4.1", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/src/components/layouts/Header.tsx b/src/components/layouts/SwitchPlatform.tsx similarity index 55% rename from src/components/layouts/Header.tsx rename to src/components/layouts/SwitchPlatform.tsx index 1dfe469a..719e1ccf 100644 --- a/src/components/layouts/Header.tsx +++ b/src/components/layouts/SwitchPlatform.tsx @@ -19,7 +19,7 @@ import { capitalizeFirstChar } from '../../helpers/helper'; import { StorageService } from '../../services/StorageService'; import { ICommunityPlatfromProps } from '../../utils/interfaces'; -const Header = () => { +const SwitchPlatform = () => { const { community, selectedPlatform, handleSwitchPlatform } = useToken(); const [platforms, setPlatforms] = useState([]); @@ -77,59 +77,53 @@ const Header = () => { }; return ( - - - - - Select Platform: - - - - - - + + + + Select Platform: + + + + + ); }; -export default Header; +export default SwitchPlatform; diff --git a/src/layouts/defaultLayout.tsx b/src/layouts/defaultLayout.tsx index 34aee201..cc233136 100644 --- a/src/layouts/defaultLayout.tsx +++ b/src/layouts/defaultLayout.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import Header from '../components/layouts/Header'; import TcPrompt from '../components/layouts/shared/TcPrompt'; import Sidebar from '../components/layouts/Sidebar'; import SidebarXs from '../components/layouts/xs/SidebarXs'; @@ -17,7 +16,6 @@ export const defaultLayout = ({ children }: IDefaultLayoutProps) => {
-
{children}
diff --git a/src/lib/contracts/engagement/contracts.ts b/src/lib/contracts/engagement/contracts.ts index 2df88e12..fc5fc4fe 100644 --- a/src/lib/contracts/engagement/contracts.ts +++ b/src/lib/contracts/engagement/contracts.ts @@ -577,4 +577,582 @@ export const engagementContracts = [ }, ], }, + { + chainId: 42_161, + address: '0x89aDc2E7561914884c47a2F5447ac5052e6770b1', + abi: [ + { + inputs: [{ internalType: 'string', name: 'tokenURI_', type: 'string' }], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { inputs: [], name: 'AccessControlBadConfirmation', type: 'error' }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'bytes32', name: 'neededRole', type: 'bytes32' }, + ], + name: 'AccessControlUnauthorizedAccount', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'sender', type: 'address' }, + { internalType: 'uint256', name: 'balance', type: 'uint256' }, + { internalType: 'uint256', name: 'needed', type: 'uint256' }, + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + ], + name: 'ERC1155InsufficientBalance', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'approver', type: 'address' }, + ], + name: 'ERC1155InvalidApprover', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'idsLength', type: 'uint256' }, + { internalType: 'uint256', name: 'valuesLength', type: 'uint256' }, + ], + name: 'ERC1155InvalidArrayLength', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'operator', type: 'address' }, + ], + name: 'ERC1155InvalidOperator', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'receiver', type: 'address' }, + ], + name: 'ERC1155InvalidReceiver', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], + name: 'ERC1155InvalidSender', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'operator', type: 'address' }, + { internalType: 'address', name: 'owner', type: 'address' }, + ], + name: 'ERC1155MissingApprovalForAll', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'message', type: 'string' }], + name: 'EmptyAccountNotAllowed', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + ], + name: 'MintLimit', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + ], + name: 'NotAllowed', + type: 'error', + }, + { + inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }], + name: 'NotFound', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'message', type: 'string' }], + name: 'URIEmpty', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'oldURI', + type: 'string', + }, + { + indexed: false, + internalType: 'string', + name: 'newURI', + type: 'string', + }, + ], + name: 'BaseURIUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Burn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Issue', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Mint', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'values', + type: 'uint256[]', + }, + ], + name: 'TransferBatch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'TransferSingle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'value', + type: 'string', + }, + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'URI', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'uint256', name: 'id', type: 'uint256' }, + ], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: 'accounts', type: 'address[]' }, + { internalType: 'uint256[]', name: 'ids', type: 'uint256[]' }, + ], + name: 'balanceOfBatch', + outputs: [{ internalType: 'uint256[]', name: '', type: 'uint256[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'counter', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: 'role', type: 'bytes32' }], + name: 'getRoleAdmin', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'hasRole', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'address', name: 'operator', type: 'address' }, + ], + name: 'isApprovedForAll', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'issue', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { + internalType: 'address', + name: 'callerConfirmation', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256[]', name: 'ids', type: 'uint256[]' }, + { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'safeBatchTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'operator', type: 'address' }, + { internalType: 'bool', name: 'approved', type: 'bool' }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }, + ], + name: 'supportsInterface', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'string', name: 'newURI', type: 'string' }], + name: 'updateBaseURI', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + name: 'uri', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'tokenId', type: 'uint256' }, + { internalType: 'string', name: 'account', type: 'string' }, + ], + name: 'uri', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + ], + }, ]; diff --git a/src/pages/community-health.tsx b/src/pages/community-health.tsx index abfdbd6f..c0587998 100644 --- a/src/pages/community-health.tsx +++ b/src/pages/community-health.tsx @@ -19,6 +19,8 @@ import { import { withRoles } from '@/utils/withRoles'; import emptyState from '../assets/svg/empty-state.svg'; +import SwitchPlatform from '@/components/layouts/SwitchPlatform'; +import { Stack } from '@mui/material'; function CommunityHealth() { const { community, selectedPlatform } = useToken(); @@ -68,9 +70,22 @@ function CommunityHealth() {
-

- Community Health -

+ + +

+ Community Health +

{' '} +
+ +
diff --git a/src/pages/community-settings/reputation-score/index.tsx b/src/pages/community-settings/reputation-score/index.tsx index 879f70b2..2f2091e1 100644 --- a/src/pages/community-settings/reputation-score/index.tsx +++ b/src/pages/community-settings/reputation-score/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { Alert, AlertTitle, Button, Stack, Typography } from '@mui/material'; import { ConnectButton } from '@rainbow-me/rainbowkit'; +import Link from 'next/link'; import { Abi } from 'viem'; import { useAccount, @@ -100,8 +101,13 @@ function Index() { Reputation Score is enabled for this community. - In order to make any change please contact to the customer - support. + For any changes please contact{' '} + + customer support + {' '} )} @@ -109,19 +115,69 @@ function Index() { - + Reputation Score - Reputation score is a number that represents the - trustworthiness of a user in the community. It is calculated - based on the user's activity and behavior in the community. + set up your community’s reputation score to turn offchain + activity into onchain points. + + + A member’s reputation score captures their involvement in + your community. The score is stored onchain and updates + weekly and combines a member’s activity and influence. No + identifiable information is stored onchain.{' '} + + Read more + + + How it works + + + 1.You activate the reputation module for your community. + We will link your community with a specific community id + token. + + + 2.Any member who has{' '} + + view + {' '} + access to togethercrew.com can mint their reputation + score. + + + 3.Your members will log into togethercrew.com, connect + their wallet and link their discord handle to their + wallet. This attestation is encrypted. Personal + identifiers are not stored onchain. + + + 4.Your members can see their reputation score on + togethercrew.com and in their wallet. + + + + {isConnected ? ( ) : ( '' diff --git a/src/pages/index.tsx b/src/pages/index.tsx index de6ddee7..37d4fe2f 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,6 +1,9 @@ import React from 'react'; +import { Stack } from '@mui/material'; import Image from 'next/image'; +import SwitchPlatform from '@/components/layouts/SwitchPlatform'; + import emptyState from '../assets/svg/empty-state.svg'; import EmptyState from '../components/global/EmptyState'; import SEO from '../components/global/SEO'; @@ -34,9 +37,24 @@ function Index(): JSX.Element {
-

- Community Insights -

+ + +

+ Community Insights +

{' '} +
+ +
+
diff --git a/src/pages/membersInteraction.tsx b/src/pages/membersInteraction.tsx index 415a9aac..8376a76c 100644 --- a/src/pages/membersInteraction.tsx +++ b/src/pages/membersInteraction.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Paper, Popover } from '@mui/material'; +import { Paper, Popover, Stack } from '@mui/material'; import dynamic from 'next/dynamic'; import Image from 'next/image'; import { AiOutlineExclamationCircle, AiOutlineLeft } from 'react-icons/ai'; @@ -16,6 +16,7 @@ import { useToken } from '../context/TokenContext'; import { defaultLayout } from '../layouts/defaultLayout'; import useAppStore from '../store/useStore'; import { withRoles } from '../utils/withRoles'; +import SwitchPlatform from '@/components/layouts/SwitchPlatform'; const ForceGraphComponent = dynamic( () => @@ -170,9 +171,22 @@ function MembersInteraction() { }} className='space-y-4 overflow-hidden rounded-xl px-4 py-6 shadow-box md:px-8' > -

- Member interactions graph -

+ + +

+ Member interactions graph +

{' '} +
+ +

Data from the last 7 days

diff --git a/src/pages/reputation-score/index.tsx b/src/pages/reputation-score/index.tsx index 3cc1ece8..70f26af8 100644 --- a/src/pages/reputation-score/index.tsx +++ b/src/pages/reputation-score/index.tsx @@ -41,20 +41,25 @@ function ReputationScore() {
Reputation Score - + Reputation Score is a number between 0 and 100 that represents - the trustworthiness of a user. It is calculated based on the - user's activity on the platform. The higher the score, the more - trustworthy the user is. + how involved in the community a member is. It is calculated + based on a user's interactions with other community members on + the community platforms. The higher the score the more involved + a member is.
{!isConnected && ( @@ -66,7 +71,7 @@ function ReputationScore() { )} - + ( To mint your reputation score, please connect your wallet. - + @@ -177,12 +177,14 @@ const AttestationSection: React.FC = ({ return ( - Join the On-Chain Platform + + Verify your identity across platforms + - TogetherCrew has partnered with an on-chain platform to create secure, - on-chain attestations of user credentials. With on-chain access, you - can grant permission to applications, enabling them to decrypt and - verify your credentials. + We use secure onchain verification through the LogID platform created + by TogetherCrew. LogID enables you to verify your ID, create a privacy + preserving proof (encrypted), and manage which applications can see + your credentials by decrypting the data. {isConnected && ( = ({ )) ) : ( - + No Attestations Found - In order to mint your reputation score, you need to have - idenitifers connected to wallet address. please register - your wallet on On-chain platform and attestation your - idenitifers. + To mind your reputation score, please connect at least + one account and verify ownership. )} diff --git a/src/pages/statistics.tsx b/src/pages/statistics.tsx index 9a76b069..f098de38 100644 --- a/src/pages/statistics.tsx +++ b/src/pages/statistics.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/jsx-key */ import { useEffect, useState } from 'react'; -import { Box } from '@mui/material'; +import { Box, Stack } from '@mui/material'; import moment from 'moment'; import Image from 'next/image'; import { useRouter } from 'next/router'; @@ -23,6 +23,7 @@ import { transformToMidnightUTC } from '../helpers/momentHelper'; import { defaultLayout } from '../layouts/defaultLayout'; import useAppStore from '../store/useStore'; import { withRoles } from '../utils/withRoles'; +import SwitchPlatform from '@/components/layouts/SwitchPlatform'; const Statistics = () => { const { community, selectedPlatform } = useToken(); @@ -316,12 +317,21 @@ const Statistics = () => { } />
- -
- - Community Insights -
- {' '} + + +
+ + Community Insights +
+ + +