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

update direct grants #43

Merged
merged 1 commit into from
Feb 26, 2024
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
1 change: 1 addition & 0 deletions dist/strategies/DirectGrants/DirectGrantsStrategy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ export declare class DirectGrantsStrategy {
getAllocationData(recipientId: `0x${string}`, status: Status, grantAmount: bigint): TransactionData;
getBatchAllocationData(allocations: Allocation[]): TransactionData;
getDistributeData(recipientIds: `0x${string}`[]): TransactionData;
getUpdatePoolTimestampsData(registrationStartTime: number, registrationEndTime: number): TransactionData;
}
19 changes: 17 additions & 2 deletions dist/strategies/DirectGrants/DirectGrantsStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ class DirectGrantsStrategy {
}
// Get the DirectGrants strategy InitializeData
getInitializeData(params) {
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("bool, bool, bool"), [
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("bool, bool, bool, uint128, uint128"), [
params.registryGating,
params.metadataRequired,
params.grantAmountRequired,
BigInt(params.registrationStartTime),
BigInt(params.registrationEndTime),
]);
return encoded;
}
getDeployParams() {
const constructorArgs = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, string"), [this.allo.address(), "DirectGrantsSimpleStrategy1.0"]);
const constructorArgs = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, string"), [this.allo.address(), "DirectGrantsSimpleStrategy1.1"]);
const constructorArgsNo0x = constructorArgs.slice(2);
return {
abi: directGrants_config_1.abi,
Expand Down Expand Up @@ -404,5 +406,18 @@ class DirectGrantsStrategy {
value: "0",
};
}
getUpdatePoolTimestampsData(registrationStartTime, registrationEndTime) {
this.checkStrategy();
const encodedData = (0, viem_1.encodeFunctionData)({
abi: directGrants_config_1.abi,
functionName: "updatePoolTimestamps",
args: [BigInt(registrationStartTime), BigInt(registrationEndTime)],
});
return {
to: this.strategy,
data: encodedData,
value: "0",
};
}
}
exports.DirectGrantsStrategy = DirectGrantsStrategy;
136 changes: 68 additions & 68 deletions dist/strategies/DirectGrants/directGrants.config.d.ts

Large diffs are not rendered by default.

Loading
Loading