Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set the matching pool token & amount to be something other than usd #1517

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions migration/1714566501335-addTokenAndChainToQFRound.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddTokenAndChainToQFRound1714566501335
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE IF EXISTS "qf_round"
ADD COLUMN IF NOT EXISTS "allocatedTokenSymbol" text,
ADD COLUMN IF NOT EXISTS "allocatedTokenChainId" integer;
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE IF EXISTS "qf_round"
DROP COLUMN "allocatedTokenSymbol",
DROP COLUMN "allocatedTokenChainId";
`);
}
}
8 changes: 8 additions & 0 deletions src/entities/qfRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export class QfRound extends BaseEntity {
@Column()
allocatedFund: number;

@Field(_type => String, { nullable: true })
@Column({ nullable: true })
allocatedTokenSymbol: string;

@Field(_type => Number, { nullable: true })
@Column({ nullable: true })
allocatedTokenChainId: number;

@Field(_type => Number)
@Column('real', { default: 0.2 })
maximumReward: number;
Expand Down
54 changes: 32 additions & 22 deletions src/server/adminJs/tabs/qfRoundTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,29 @@ const returnAllQfRoundDonationAnalysis = async (
};
};

const availableNetworkValues = [
{ value: NETWORK_IDS.MAIN_NET, label: 'MAINNET' },
{ value: NETWORK_IDS.ROPSTEN, label: 'ROPSTEN' },
{ value: NETWORK_IDS.GOERLI, label: 'GOERLI' },
{ value: NETWORK_IDS.POLYGON, label: 'POLYGON' },
{ value: NETWORK_IDS.OPTIMISTIC, label: 'OPTIMISTIC' },
{ value: NETWORK_IDS.ETC, label: 'ETC' },
{
value: NETWORK_IDS.MORDOR_ETC_TESTNET,
label: 'MORDOR ETC TESTNET',
},
{ value: NETWORK_IDS.OPTIMISM_SEPOLIA, label: 'OPTIMISM SEPOLIA' },
{ value: NETWORK_IDS.CELO, label: 'CELO' },
{
value: NETWORK_IDS.CELO_ALFAJORES,
label: 'ALFAJORES (Test CELO)',
},
{ value: NETWORK_IDS.ARBITRUM_MAINNET, label: 'ARBITRUM MAINNET' },
{ value: NETWORK_IDS.ARBITRUM_SEPOLIA, label: 'ARBITRUM SEPOLIA' },
{ value: NETWORK_IDS.XDAI, label: 'XDAI' },
{ value: NETWORK_IDS.BSC, label: 'BSC' },
];

export const qfRoundTab = {
resource: QfRound,
options: {
Expand Down Expand Up @@ -132,6 +155,14 @@ export const qfRoundTab = {
allocatedFund: {
isVisible: true,
},
allocatedTokenSymbol: {
isVisible: true,
},
allocatedTokenChainId: {
isVisible: true,
type: 'number',
availableValues: availableNetworkValues,
},
minimumPassportScore: {
isVisible: true,
},
Expand All @@ -141,28 +172,7 @@ export const qfRoundTab = {
eligibleNetworks: {
isVisible: true,
type: 'array',
availableValues: [
{ value: NETWORK_IDS.MAIN_NET, label: 'MAINNET' },
{ value: NETWORK_IDS.ROPSTEN, label: 'ROPSTEN' },
{ value: NETWORK_IDS.GOERLI, label: 'GOERLI' },
{ value: NETWORK_IDS.POLYGON, label: 'POLYGON' },
{ value: NETWORK_IDS.OPTIMISTIC, label: 'OPTIMISTIC' },
{ value: NETWORK_IDS.ETC, label: 'ETC' },
{
value: NETWORK_IDS.MORDOR_ETC_TESTNET,
label: 'MORDOR ETC TESTNET',
},
{ value: NETWORK_IDS.OPTIMISM_SEPOLIA, label: 'OPTIMISM SEPOLIA' },
{ value: NETWORK_IDS.CELO, label: 'CELO' },
{
value: NETWORK_IDS.CELO_ALFAJORES,
label: 'ALFAJORES (Test CELO)',
},
{ value: NETWORK_IDS.ARBITRUM_MAINNET, label: 'ARBITRUM MAINNET' },
{ value: NETWORK_IDS.ARBITRUM_SEPOLIA, label: 'ARBITRUM SEPOLIA' },
{ value: NETWORK_IDS.XDAI, label: 'XDAI' },
{ value: NETWORK_IDS.BSC, label: 'BSC' },
],
availableValues: availableNetworkValues,
},
projects: {
type: 'mixed',
Expand Down
Loading