Skip to content

Commit b87b020

Browse files
committed
add retrofunding to builder
1 parent 4d78de3 commit b87b020

File tree

8 files changed

+50
-7
lines changed

8 files changed

+50
-7
lines changed

packages/builder/src/actions/rounds.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ export const loadRound =
9393
roundEndTime = Date.parse(v2Round.applicationsEndTime) / 1000;
9494
break;
9595

96+
case "allov2.EasyRetroFundingStrategy":
97+
roundPayoutStrategy = RoundCategory.Retrofunding;
98+
applicationsStartTime =
99+
Date.parse(v2Round.applicationsStartTime) / 1000;
100+
applicationsEndTime =
101+
Date.parse(v2Round.applicationsEndTime) / 1000;
102+
roundStartTime = Date.parse(v2Round.applicationsStartTime) / 1000;
103+
roundEndTime = Date.parse(v2Round.applicationsEndTime) / 1000;
104+
break;
105+
96106
case "allov1.QF":
97107
case "allov2.DonationVotingMerkleDistributionDirectTransferStrategy":
98108
default:

packages/builder/src/components/grants/rounds/RoundListItem.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ export default function RoundListItem({
9797
Direct Grant
9898
</span>
9999
) : null}
100+
{roundPayoutStrategy === RoundCategory.Retrofunding ? (
101+
<span className={`text-${colorScheme?.text} text-sm`}>
102+
Retrofunding
103+
</span>
104+
) : null}
100105
</Badge>
101106
</span>
102107
);

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test:watch": "vitest watch"
1717
},
1818
"dependencies": {
19-
"@allo-team/allo-v2-sdk": "1.0.79",
19+
"@allo-team/allo-v2-sdk": "1.1.1",
2020
"@ethersproject/abstract-signer": "^5.7.0",
2121
"@ethersproject/providers": "^5.7.2",
2222
"@gitcoin/gitcoin-chain-data": "^1.0.43",

packages/common/src/allo/backends/allo-v2.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
DonationVotingMerkleDistributionDirectTransferStrategyAbi,
99
DonationVotingMerkleDistributionStrategy,
1010
DonationVotingMerkleDistributionStrategyTypes,
11+
EasyRetroFundingStrategy,
1112
Registry,
1213
RegistryAbi,
1314
StrategyFactory,
@@ -730,6 +731,23 @@ export class AlloV2 implements Allo {
730731
break;
731732
}
732733

734+
case RoundCategory.Retrofunding: {
735+
const strategyInstance = new EasyRetroFundingStrategy({
736+
chain: this.chainId,
737+
poolId: BigInt(args.roundId),
738+
});
739+
740+
registerRecipientTx = strategyInstance.getRegisterRecipientData({
741+
registryAnchor: args.projectId,
742+
recipientAddress: metadata.application.recipient,
743+
metadata: {
744+
protocol: 1n,
745+
pointer: ipfsResult.value,
746+
},
747+
});
748+
break;
749+
}
750+
733751
default:
734752
throw new AlloError("Unsupported strategy");
735753
}

packages/common/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export type RoundPayoutTypeNew =
350350
| "allov2.DirectAllocationStrategy"
351351
| ""; // This is to handle the cases where the strategyName is not set in a round, mostly spam rounds
352352

353-
export type RoundStrategyType = "QuadraticFunding" | "DirectGrants";
353+
export type RoundStrategyType = "QuadraticFunding" | "DirectGrants" | "Retrofunding";
354354

355355
export function getRoundStrategyTitle(name: string) {
356356
switch (getRoundStrategyType(name)) {
@@ -359,6 +359,9 @@ export function getRoundStrategyTitle(name: string) {
359359

360360
case "QuadraticFunding":
361361
return "Quadratic Funding";
362+
363+
case "Retrofunding":
364+
return "Retro Funding";
362365
}
363366
}
364367

@@ -375,6 +378,9 @@ export function getRoundStrategyType(name: string): RoundStrategyType {
375378
case "allov2.DonationVotingMerkleDistributionDirectTransferStrategy":
376379
return "QuadraticFunding";
377380

381+
case "allov2.EasyRetroFundingStrategy":
382+
return "Retrofunding";
383+
378384
default:
379385
throw new Error(`Unknown round strategy type: ${name}`);
380386
}

packages/data-layer/src/data.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type RoundVisibilityType = "public" | "private";
1818
export enum RoundCategory {
1919
QuadraticFunding,
2020
Direct,
21+
Retrofunding,
2122
}
2223

2324
export type ApplicationStatus =

packages/data-layer/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export const strategyNameToCategory = (
4242
case "allov2.DirectGrantsLiteStrategy":
4343
return RoundCategory.Direct;
4444

45+
case "allov2.EasyRetroFundingStrategy":
46+
return RoundCategory.Retrofunding;
47+
4548
case "allov1.QF":
4649
case "allov2.DonationVotingMerkleDistributionDirectTransferStrategy":
4750
return RoundCategory.QuadraticFunding;

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)