Skip to content

Commit

Permalink
Add support for direct grants lite (#56)
Browse files Browse the repository at this point in the history
* Add support for direct grants lite

* fixes

* update byte code and abi

* rm unused

* build & publish

* remove bracket
  • Loading branch information
0xKurt authored Apr 23, 2024
1 parent 66b71d5 commit c85d0e3
Show file tree
Hide file tree
Showing 13 changed files with 3,330 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MicroGrantsStrategy } from "./strategies/MicroGrantsStrategy/MicroGrant
import { SQFSuperFluidStrategy } from "./strategies/SuperFluidStrategy/SQFSuperFluidStrategy";
import { DonationVotingMerkleDistributionStrategy } from "./strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution";
import { DirectGrantsStrategy } from "./strategies/DirectGrants/DirectGrantsStrategy";
import { DirectGrantsLiteStrategy } from "./strategies/DirectGrantsLiteStrategy/DirectGrantsLite";
export * from "./types";
export * from "./strategies/types";
export * from "./Registry/types";
Expand All @@ -12,11 +13,13 @@ export * as DonationVotingMerkleDistributionStrategyTypes from "./strategies/Don
export * as MicroGrantsStrategyTypes from "./strategies/MicroGrantsStrategy/types";
export * as SQFSuperFluidStrategyTypes from "./strategies/SuperFluidStrategy/types";
export * as DirectGrantsStrategyTypes from "./strategies/DirectGrants/types";
export * as DirectGrantsLiteStrategyTypes from "./strategies/DirectGrantsLiteStrategy/types";
export { abi as AlloAbi } from "./Allo/allo.config";
export { abi as RegistryAbi } from "./Registry/registry.config";
export { abi as DonationVotingMerkleDistributionDirectTransferStrategyAbi } from "./strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config";
export { abi as DonationVotingMerkleDistributionVaultStrategyAbi } from "./strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config";
export { abi as MicroGrantsStrategyAbi } from "./strategies/MicroGrantsStrategy/microGrants.config";
export { abi as SQFSuperFluidStrategyAbi } from "./strategies/SuperFluidStrategy/superfluid.config";
export { abi as DirectGrantsStrategyAbi } from "./strategies/DirectGrants/directGrants.config";
export { Allo, Registry, MicroGrantsStrategy, SQFSuperFluidStrategy, DonationVotingMerkleDistributionStrategy, DirectGrantsStrategy, };
export { abi as DirectGrantsLiteStrategyAbi } from "./strategies/DirectGrantsLiteStrategy/directGrantsLite.config";
export { Allo, Registry, MicroGrantsStrategy, SQFSuperFluidStrategy, DonationVotingMerkleDistributionStrategy, DirectGrantsStrategy, DirectGrantsLiteStrategy, };
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectGrantsStrategy = exports.DonationVotingMerkleDistributionStrategy = exports.SQFSuperFluidStrategy = exports.MicroGrantsStrategy = exports.Registry = exports.Allo = exports.DirectGrantsStrategyAbi = exports.SQFSuperFluidStrategyAbi = exports.MicroGrantsStrategyAbi = exports.DonationVotingMerkleDistributionVaultStrategyAbi = exports.DonationVotingMerkleDistributionDirectTransferStrategyAbi = exports.RegistryAbi = exports.AlloAbi = exports.DirectGrantsStrategyTypes = exports.SQFSuperFluidStrategyTypes = exports.MicroGrantsStrategyTypes = exports.DonationVotingMerkleDistributionStrategyTypes = void 0;
exports.DirectGrantsLiteStrategy = exports.DirectGrantsStrategy = exports.DonationVotingMerkleDistributionStrategy = exports.SQFSuperFluidStrategy = exports.MicroGrantsStrategy = exports.Registry = exports.Allo = exports.DirectGrantsLiteStrategyAbi = exports.DirectGrantsStrategyAbi = exports.SQFSuperFluidStrategyAbi = exports.MicroGrantsStrategyAbi = exports.DonationVotingMerkleDistributionVaultStrategyAbi = exports.DonationVotingMerkleDistributionDirectTransferStrategyAbi = exports.RegistryAbi = exports.AlloAbi = exports.DirectGrantsLiteStrategyTypes = exports.DirectGrantsStrategyTypes = exports.SQFSuperFluidStrategyTypes = exports.MicroGrantsStrategyTypes = exports.DonationVotingMerkleDistributionStrategyTypes = void 0;
const Allo_1 = require("./Allo/Allo");
Object.defineProperty(exports, "Allo", { enumerable: true, get: function () { return Allo_1.Allo; } });
const Registry_1 = require("./Registry/Registry");
Expand All @@ -27,6 +27,8 @@ const DonationVotingMerkleDistribution_1 = require("./strategies/DonationVotingM
Object.defineProperty(exports, "DonationVotingMerkleDistributionStrategy", { enumerable: true, get: function () { return DonationVotingMerkleDistribution_1.DonationVotingMerkleDistributionStrategy; } });
const DirectGrantsStrategy_1 = require("./strategies/DirectGrants/DirectGrantsStrategy");
Object.defineProperty(exports, "DirectGrantsStrategy", { enumerable: true, get: function () { return DirectGrantsStrategy_1.DirectGrantsStrategy; } });
const DirectGrantsLite_1 = require("./strategies/DirectGrantsLiteStrategy/DirectGrantsLite");
Object.defineProperty(exports, "DirectGrantsLiteStrategy", { enumerable: true, get: function () { return DirectGrantsLite_1.DirectGrantsLiteStrategy; } });
__exportStar(require("./types"), exports);
__exportStar(require("./strategies/types"), exports);
__exportStar(require("./Registry/types"), exports);
Expand All @@ -35,6 +37,7 @@ exports.DonationVotingMerkleDistributionStrategyTypes = require("./strategies/Do
exports.MicroGrantsStrategyTypes = require("./strategies/MicroGrantsStrategy/types");
exports.SQFSuperFluidStrategyTypes = require("./strategies/SuperFluidStrategy/types");
exports.DirectGrantsStrategyTypes = require("./strategies/DirectGrants/types");
exports.DirectGrantsLiteStrategyTypes = require("./strategies/DirectGrantsLiteStrategy/types");
var allo_config_1 = require("./Allo/allo.config");
Object.defineProperty(exports, "AlloAbi", { enumerable: true, get: function () { return allo_config_1.abi; } });
var registry_config_1 = require("./Registry/registry.config");
Expand All @@ -49,3 +52,5 @@ var superfluid_config_1 = require("./strategies/SuperFluidStrategy/superfluid.co
Object.defineProperty(exports, "SQFSuperFluidStrategyAbi", { enumerable: true, get: function () { return superfluid_config_1.abi; } });
var directGrants_config_1 = require("./strategies/DirectGrants/directGrants.config");
Object.defineProperty(exports, "DirectGrantsStrategyAbi", { enumerable: true, get: function () { return directGrants_config_1.abi; } });
var directGrantsLite_config_1 = require("./strategies/DirectGrantsLiteStrategy/directGrantsLite.config");
Object.defineProperty(exports, "DirectGrantsLiteStrategyAbi", { enumerable: true, get: function () { return directGrantsLite_config_1.abi; } });
88 changes: 88 additions & 0 deletions dist/strategies/DirectGrantsLiteStrategy/DirectGrantsLite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { Allo } from "../../Allo/Allo";
import { ConstructorArgs, DeployParams, TransactionData } from "../../Common/types";
import { Status } from "../types";
import { Allocation, InitializeData, Recipient, RegisterData } from "./types";
export declare class DirectGrantsLiteStrategy {
private client;
private contract;
private strategy;
private poolId;
private allo;
constructor({ chain, rpc, address, poolId }: ConstructorArgs);
getAllo(): Promise<Allo>;
setPoolId(poolId: bigint): Promise<void>;
setContract(address: `0x${string}`): void;
private checkPoolId;
private checkStrategy;
getNative(): Promise<string>;
useRegistryAnchor(): Promise<boolean>;
metadataRequired(): Promise<boolean>;
registrationStartTime(): Promise<bigint>;
registrationEndTime(): Promise<bigint>;
recipientsCounter(): Promise<bigint>;
statusesBitMap(index: bigint): Promise<bigint>;
recipientToStatusIndexes(recipient: string): Promise<bigint[]>;
getPoolAmount(): Promise<bigint>;
getPoolId(): Promise<bigint>;
getRecipient(recipientId: string): Promise<Recipient>;
getRecipientStatus(recipientId: string): Promise<Status>;
getStrategyId(): Promise<string>;
isPoolActive(): Promise<boolean>;
isValidAllocator(allocator: `0x${string}`): Promise<boolean>;
/**
* Write functions
*/
/**
*
* @returns DeployParams {abi, bytecode}
*/
getDeployParams(): DeployParams;
getInitializeData(data: InitializeData): Promise<`0x${string}`>;
/**
*
* @param data - Allocation: (address,(((address,uint256),uint256,uint256),bytes))
* @returns `0x${string}`
*/
getEncodedAllocation(data: Allocation): `0x${string}`;
/**
*
* @param allocation - Allocation[]: [{token: `0x${string}`, recipientId: `0x${string}`, amount: bigint}]
* @returns TransactionData: {to: `0x${string}`, data: `0x${string}`, value: string}
*/
getAllocateData(allocations: Allocation[]): TransactionData;
/**
*
* @param data - (address, address, Metadata)
* @returns
*/
getRegisterRecipientData(data: RegisterData): TransactionData;
/**
* Batch register recipients
*
* @param data - Array of RegisterDataDirectGrantsLiteVoting
*
* @returns TransactionData
*/
getBatchRegisterRecipientData(data: RegisterData[]): TransactionData;
/**
* Provides a function to batch together multiple calls in a single external call
*
* @param data - Array of encoded data
*
* @returns - Encoded transaction data
*/
multicall(data: `0x${string}`[]): TransactionData;
/**
* Review recipients
*
* @param statuses - Array of status indexes and statusRows
*
* @returns TransactionData
*/
reviewRecipients(statuses: {
index: bigint;
statusRow: bigint;
}[], refRecipientsCounter: bigint): TransactionData;
updatePoolTimestamps(registrationStartTime: bigint, registrationEndTime: bigint): TransactionData;
withdraw(address: `0x${string}`): TransactionData;
}
Loading

0 comments on commit c85d0e3

Please sign in to comment.