Skip to content

Commit

Permalink
Merge pull request #1842 from gitcoinco/1757_expand_gtc_community_sta…
Browse files Browse the repository at this point in the history
…king

feat(platforms,app): updates GTC community staking
  • Loading branch information
aminah-io authored Nov 7, 2023
2 parents d78f264 + d9d950a commit 3db62b1
Show file tree
Hide file tree
Showing 17 changed files with 693 additions and 659 deletions.
43 changes: 25 additions & 18 deletions app/components/StampSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,31 @@ export function StampSelector({
const checkboxId = `${provider.name}StampCheckbox`;

return (
<div
key={provider.name}
data-testid={`indicator-${provider.name}`}
className={`relative border-foreground-3 py-3 text-base ${
i > 0 ? "border-t" : "border-none"
} ${textColor} flex items-center`}
>
<Checkbox
data-testid={`checkbox-${provider.name}`}
className="mr-2 shrink-0"
id={checkboxId}
checked={selected}
onChange={onChange}
/>
<label htmlFor={checkboxId}>{provider.title}</label>
{FeatureFlags.FF_CHAIN_SYNC && isProviderOnChain(provider.name) && <OnchainTag marginLeft="3" />}
<span className="ml-2 grow text-right">{weight}&nbsp;points</span>
</div>
<>
<div
key={provider.name}
data-testid={`indicator-${provider.name}`}
className={`relative border-foreground-3 ${provider.description ? "pt-3" : "py-3"} text-base ${
i > 0 ? "border-t" : "border-none"
} ${textColor} flex items-center`}
>
<Checkbox
data-testid={`checkbox-${provider.name}`}
className="mr-2 shrink-0"
id={checkboxId}
checked={selected}
onChange={onChange}
/>
<label htmlFor={checkboxId}>{provider.title}</label>
{FeatureFlags.FF_CHAIN_SYNC && isProviderOnChain(provider.name) && <OnchainTag marginLeft="3" />}
<span className="ml-2 grow text-right">{weight}&nbsp;points</span>
</div>
{provider.description && (
<>
<p className="my-2 text-sm italic">{provider.description}</p>
</>
)}
</>
);
})}
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const nextJest = require("next/jest");
global.TextDecoder = require("util").TextDecoder;

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
Expand All @@ -8,6 +9,7 @@ const createJestConfig = nextJest({
// Add any custom config to be passed to Jest
const customJestConfig = {
testEnvironment: "jest-environment-jsdom",
testEnvironmentOptions: {},
moduleNameMapper: {
"\\.(gif|ttf|eot|svg|png)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
Expand Down
4 changes: 4 additions & 0 deletions app/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import "@testing-library/jest-dom/extend-expect";

import { TextDecoder, TextEncoder } from "util";
global.TextDecoder = TextDecoder as any;
global.TextEncoder = TextEncoder as any;
2 changes: 1 addition & 1 deletion iam/src/static/providerBitMapInfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"bit":0,"index":0,"name":"SelfStakingBronze"},{"bit":1,"index":0,"name":"SelfStakingSilver"},{"bit":2,"index":0,"name":"SelfStakingGold"},{"bit":3,"index":0,"name":"CommunityStakingBronze"},{"bit":4,"index":0,"name":"CommunityStakingSilver"},{"bit":5,"index":0,"name":"CommunityStakingGold"},{"bit":6,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#1"},{"bit":7,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#10"},{"bit":8,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#25"},{"bit":9,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#100"},{"bit":10,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#10"},{"bit":11,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#100"},{"bit":12,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#1000"},{"bit":13,"index":0,"name":"GitcoinContributorStatistics#numGr14ContributionsGte#1"},{"bit":14,"index":0,"name":"GitcoinContributorStatistics#numRoundsContributedToGte#1"},{"bit":15,"index":0,"name":"twitterAccountAgeGte#180"},{"bit":16,"index":0,"name":"twitterAccountAgeGte#365"},{"bit":17,"index":0,"name":"twitterAccountAgeGte#730"},{"bit":18,"index":0,"name":"Discord"},{"bit":19,"index":0,"name":"Google"},{"bit":20,"index":0,"name":"githubAccountCreationGte#90"},{"bit":21,"index":0,"name":"githubAccountCreationGte#180"},{"bit":22,"index":0,"name":"githubAccountCreationGte#365"},{"bit":23,"index":0,"name":"githubContributionActivityGte#30"},{"bit":24,"index":0,"name":"githubContributionActivityGte#60"},{"bit":25,"index":0,"name":"githubContributionActivityGte#120"},{"bit":26,"index":0,"name":"Facebook"},{"bit":27,"index":0,"name":"FacebookProfilePicture"},{"bit":28,"index":0,"name":"Linkedin"},{"bit":29,"index":0,"name":"Ens"},{"bit":30,"index":0,"name":"Brightid"},{"bit":31,"index":0,"name":"Poh"},{"bit":32,"index":0,"name":"ethPossessionsGte#1"},{"bit":33,"index":0,"name":"ethPossessionsGte#10"},{"bit":34,"index":0,"name":"ethPossessionsGte#32"},{"bit":35,"index":0,"name":"FirstEthTxnProvider"},{"bit":36,"index":0,"name":"EthGTEOneTxnProvider"},{"bit":37,"index":0,"name":"EthGasProvider"},{"bit":38,"index":0,"name":"SnapshotVotesProvider"},{"bit":39,"index":0,"name":"SnapshotProposalsProvider"},{"bit":40,"index":0,"name":"NFT"},{"bit":41,"index":0,"name":"ZkSync"},{"bit":42,"index":0,"name":"ZkSyncEra"},{"bit":43,"index":0,"name":"Lens"},{"bit":44,"index":0,"name":"GnosisSafe"},{"bit":45,"index":0,"name":"Coinbase"},{"bit":46,"index":0,"name":"GuildMember"},{"bit":47,"index":0,"name":"GuildAdmin"},{"bit":48,"index":0,"name":"GuildPassportMember"},{"bit":49,"index":0,"name":"Hypercerts"},{"bit":50,"index":0,"name":"PHIActivitySilver"},{"bit":51,"index":0,"name":"PHIActivityGold"},{"bit":52,"index":0,"name":"HolonymGovIdProvider"},{"bit":53,"index":0,"name":"IdenaState#Newbie"},{"bit":54,"index":0,"name":"IdenaState#Verified"},{"bit":55,"index":0,"name":"IdenaState#Human"},{"bit":56,"index":0,"name":"IdenaStake#1k"},{"bit":57,"index":0,"name":"IdenaStake#10k"},{"bit":58,"index":0,"name":"IdenaStake#100k"},{"bit":59,"index":0,"name":"IdenaAge#5"},{"bit":60,"index":0,"name":"IdenaAge#10"},{"bit":61,"index":0,"name":"CivicCaptchaPass"},{"bit":62,"index":0,"name":"CivicUniquenessPass"},{"bit":63,"index":0,"name":"CivicLivenessPass"},{"bit":64,"index":0,"name":"CyberProfilePremium"},{"bit":65,"index":0,"name":"CyberProfilePaid"},{"bit":66,"index":0,"name":"CyberProfileOrgMember"},{"bit":67,"index":0,"name":"GrantsStack3Projects"},{"bit":68,"index":0,"name":"GrantsStack5Projects"},{"bit":69,"index":0,"name":"GrantsStack7Projects"},{"bit":70,"index":0,"name":"GrantsStack2Programs"},{"bit":71,"index":0,"name":"GrantsStack4Programs"},{"bit":72,"index":0,"name":"GrantsStack6Programs"},{"bit":73,"index":0,"name":"TrustaLabs"}]
[{"bit":0,"index":0,"name":"SelfStakingBronze"},{"bit":1,"index":0,"name":"SelfStakingSilver"},{"bit":2,"index":0,"name":"SelfStakingGold"},{"bit":3,"index":0,"name":"CommunityStakingBronze"},{"bit":4,"index":0,"name":"CommunityStakingSilver"},{"bit":5,"index":0,"name":"CommunityStakingGold"},{"bit":6,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#1"},{"bit":7,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#10"},{"bit":8,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#25"},{"bit":9,"index":0,"name":"GitcoinContributorStatistics#numGrantsContributeToGte#100"},{"bit":10,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#10"},{"bit":11,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#100"},{"bit":12,"index":0,"name":"GitcoinContributorStatistics#totalContributionAmountGte#1000"},{"bit":13,"index":0,"name":"GitcoinContributorStatistics#numGr14ContributionsGte#1"},{"bit":14,"index":0,"name":"GitcoinContributorStatistics#numRoundsContributedToGte#1"},{"bit":15,"index":0,"name":"twitterAccountAgeGte#180"},{"bit":16,"index":0,"name":"twitterAccountAgeGte#365"},{"bit":17,"index":0,"name":"twitterAccountAgeGte#730"},{"bit":18,"index":0,"name":"Discord"},{"bit":19,"index":0,"name":"Google"},{"bit":20,"index":0,"name":"githubAccountCreationGte#90"},{"bit":21,"index":0,"name":"githubAccountCreationGte#180"},{"bit":22,"index":0,"name":"githubAccountCreationGte#365"},{"bit":23,"index":0,"name":"githubContributionActivityGte#30"},{"bit":24,"index":0,"name":"githubContributionActivityGte#60"},{"bit":25,"index":0,"name":"githubContributionActivityGte#120"},{"bit":26,"index":0,"name":"Facebook"},{"bit":27,"index":0,"name":"FacebookProfilePicture"},{"bit":28,"index":0,"name":"Linkedin"},{"bit":29,"index":0,"name":"Ens"},{"bit":30,"index":0,"name":"Brightid"},{"bit":31,"index":0,"name":"Poh"},{"bit":32,"index":0,"name":"ethPossessionsGte#1"},{"bit":33,"index":0,"name":"ethPossessionsGte#10"},{"bit":34,"index":0,"name":"ethPossessionsGte#32"},{"bit":35,"index":0,"name":"FirstEthTxnProvider"},{"bit":36,"index":0,"name":"EthGTEOneTxnProvider"},{"bit":37,"index":0,"name":"EthGasProvider"},{"bit":38,"index":0,"name":"SnapshotVotesProvider"},{"bit":39,"index":0,"name":"SnapshotProposalsProvider"},{"bit":40,"index":0,"name":"NFT"},{"bit":41,"index":0,"name":"ZkSync"},{"bit":42,"index":0,"name":"ZkSyncEra"},{"bit":43,"index":0,"name":"Lens"},{"bit":44,"index":0,"name":"GnosisSafe"},{"bit":45,"index":0,"name":"Coinbase"},{"bit":46,"index":0,"name":"GuildMember"},{"bit":47,"index":0,"name":"GuildAdmin"},{"bit":48,"index":0,"name":"GuildPassportMember"},{"bit":49,"index":0,"name":"Hypercerts"},{"bit":50,"index":0,"name":"PHIActivitySilver"},{"bit":51,"index":0,"name":"PHIActivityGold"},{"bit":52,"index":0,"name":"HolonymGovIdProvider"},{"bit":53,"index":0,"name":"IdenaState#Newbie"},{"bit":54,"index":0,"name":"IdenaState#Verified"},{"bit":55,"index":0,"name":"IdenaState#Human"},{"bit":56,"index":0,"name":"IdenaStake#1k"},{"bit":57,"index":0,"name":"IdenaStake#10k"},{"bit":58,"index":0,"name":"IdenaStake#100k"},{"bit":59,"index":0,"name":"IdenaAge#5"},{"bit":60,"index":0,"name":"IdenaAge#10"},{"bit":61,"index":0,"name":"CivicCaptchaPass"},{"bit":62,"index":0,"name":"CivicUniquenessPass"},{"bit":63,"index":0,"name":"CivicLivenessPass"},{"bit":64,"index":0,"name":"CyberProfilePremium"},{"bit":65,"index":0,"name":"CyberProfilePaid"},{"bit":66,"index":0,"name":"CyberProfileOrgMember"},{"bit":67,"index":0,"name":"GrantsStack3Projects"},{"bit":68,"index":0,"name":"GrantsStack5Projects"},{"bit":69,"index":0,"name":"GrantsStack7Projects"},{"bit":70,"index":0,"name":"GrantsStack2Programs"},{"bit":71,"index":0,"name":"GrantsStack4Programs"},{"bit":72,"index":0,"name":"GrantsStack6Programs"},{"bit":73,"index":0,"name":"TrustaLabs"},{"bit":74,"index":0,"name":"BeginnerCommunityStaker"},{"bit":75,"index":0,"name":"ExperiencedCommunityStaker"},{"bit":76,"index":0,"name":"TrustedCitizen"}]
7 changes: 5 additions & 2 deletions platforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
"@gitcoin/passport-types": "^1.0.0",
"@spruceid/didkit-wasm": "^0.3.0-alpha0",
"axios": "^0.26.1",
"typescript": "~4.6.3",
"redis": "^4.6.10"
"bignumber.js": "4.0.4",
"cid": "multiformats/cid",
"multiformats": "9",
"redis": "^4.6.10",
"typescript": "~4.6.3"
},
"devDependencies": {
"jest": "^27.5.1",
Expand Down
31 changes: 22 additions & 9 deletions platforms/src/GtcStaking/Providers-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
SelfStakingBronzeProvider,
SelfStakingGoldProvider,
SelfStakingSilverProvider,
CommunityStakingBronzeProvider,
CommunityStakingGoldProvider,
CommunityStakingSilverProvider,
BeginnerCommunityStakerProvider,
ExperiencedCommunityStakerProvider,
TrustedCitizenProvider,
} from "./Providers";

export const PlatformDetails: PlatformSpec = {
Expand All @@ -29,9 +29,22 @@ export const ProviderConfig: PlatformGroupSpec[] = [
{
platformGroup: "Community GTC Staking",
providers: [
{ title: "5 GTC (Bronze)", name: "CommunityStakingBronze" },
{ title: "20 GTC (Silver)", name: "CommunityStakingSilver" },
{ title: "125 GTC (Gold)", name: "CommunityStakingGold" },
{
title: "Beginner Community Staker",
description: "Stake 5 GTC on at least 1 account or have 1 account stake 5 GTC on you.",
name: "BeginnerCommunityStaker",
},
{
title: "Experienced Community Staker",
description:
"Stake 10 GTC on at least 2 accounts or have 2 accounts stake 10 GTC on you. If someone stakes 10 GTC on you and you stake 10 GTC on them, that also qualifies.",
name: "ExperiencedCommunityStaker",
},
{
title: "Trusted Citizen",
description: "Receive stakes from 5 unique users, each staking a minimum of 20 GTC on you.",
name: "TrustedCitizen",
},
],
},
];
Expand All @@ -40,7 +53,7 @@ export const providers: Provider[] = [
new SelfStakingBronzeProvider(),
new SelfStakingSilverProvider(),
new SelfStakingGoldProvider(),
new CommunityStakingBronzeProvider(),
new CommunityStakingSilverProvider(),
new CommunityStakingGoldProvider(),
new BeginnerCommunityStakerProvider(),
new ExperiencedCommunityStakerProvider(),
new TrustedCitizenProvider(),
];
Loading

0 comments on commit 3db62b1

Please sign in to comment.