From fdec199bf491af2fc79e4bf35097d4fa7cba423c Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Wed, 20 Dec 2023 13:58:57 +0100 Subject: [PATCH 1/4] updated donation voting merkle functions --- dist/__tests__ignore/Allo/Allo.test.d.ts | 1 + dist/__tests__ignore/Allo/Allo.test.js | 276 ++++ .../Registry/Registry.test.d.ts | 2 + .../__tests__ignore/Registry/Registry.test.js | 210 +++ .../Strategy/DonationVoting.test.d.ts | 1 + .../Strategy/DonationVoting.test.js | 317 +++++ .../Strategy/MicroGrants.test.d.ts | 1 + .../Strategy/MicroGrants.test.js | 74 + dist/__tests__ignore/utils/utils.d.ts | 3 + dist/__tests__ignore/utils/utils.js | 16 + .../DonationVotingMerkleDistribution.d.ts | 49 +- .../DonationVotingMerkleDistribution.js | 255 +++- .../donationVotingDirect.config.d.ts | 120 ++ .../donationVotingDirect.config.js | 1136 +++++++++++++++ .../donationVotingVault.config.d.ts | 120 ++ .../donationVotingVault.config.js | 1248 ++++++++++++++++ .../types.d.ts | 34 +- .../types.js | 5 + package.json | 2 +- .../Allo/Allo.test.ts | 0 .../Registry/Registry.test.ts | 0 .../Strategy/DonationVoting.test.ts | 0 .../Strategy/MicroGrants.test.ts | 0 .../utils/utils.ts | 0 .../DonationVotingMerkleDistribution.ts | 412 +++++- .../donationVoting.config.ts | 1225 ---------------- .../donationVotingDirect.config.ts | 1137 +++++++++++++++ .../donationVotingVault.config.ts | 1250 +++++++++++++++++ .../types.ts | 38 +- tsconfig.json | 19 +- 30 files changed, 6574 insertions(+), 1377 deletions(-) create mode 100644 dist/__tests__ignore/Allo/Allo.test.d.ts create mode 100644 dist/__tests__ignore/Allo/Allo.test.js create mode 100644 dist/__tests__ignore/Registry/Registry.test.d.ts create mode 100644 dist/__tests__ignore/Registry/Registry.test.js create mode 100644 dist/__tests__ignore/Strategy/DonationVoting.test.d.ts create mode 100644 dist/__tests__ignore/Strategy/DonationVoting.test.js create mode 100644 dist/__tests__ignore/Strategy/MicroGrants.test.d.ts create mode 100644 dist/__tests__ignore/Strategy/MicroGrants.test.js create mode 100644 dist/__tests__ignore/utils/utils.d.ts create mode 100644 dist/__tests__ignore/utils/utils.js create mode 100644 dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.d.ts create mode 100644 dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.js create mode 100644 dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.d.ts create mode 100644 dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.js rename src/{__tests__ => __tests__ignore}/Allo/Allo.test.ts (100%) rename src/{__tests__ => __tests__ignore}/Registry/Registry.test.ts (100%) rename src/{__tests__ => __tests__ignore}/Strategy/DonationVoting.test.ts (100%) rename src/{__tests__ => __tests__ignore}/Strategy/MicroGrants.test.ts (100%) rename src/{__tests__ => __tests__ignore}/utils/utils.ts (100%) delete mode 100644 src/strategies/DonationVotingMerkleDistributionStrategy/donationVoting.config.ts create mode 100644 src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.ts create mode 100644 src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.ts diff --git a/dist/__tests__ignore/Allo/Allo.test.d.ts b/dist/__tests__ignore/Allo/Allo.test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/__tests__ignore/Allo/Allo.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/__tests__ignore/Allo/Allo.test.js b/dist/__tests__ignore/Allo/Allo.test.js new file mode 100644 index 0000000..b9f4403 --- /dev/null +++ b/dist/__tests__ignore/Allo/Allo.test.js @@ -0,0 +1,276 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Allo_1 = require("../../Allo/Allo"); +const utils_1 = require("../utils/utils"); +const address = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; +const metadata = { + protocol: BigInt(1), + pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", +}; +jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { + return { + read: { + isPoolAdmin: jest.fn(() => true), + isPoolManager: jest.fn(() => true), + isCloneableStrategy: jest.fn(() => true), + getStrategy: jest.fn(() => (0, utils_1.makeAddress)("STRATEGY")), + getPercentFee: jest.fn(() => 0), + getBaseFee: jest.fn(() => 0), + getTreasury: jest.fn(() => (0, utils_1.makeAddress)("TREASURY")), + getRegistry: jest.fn(() => (0, utils_1.makeAddress)("REGISTRY")), + getPool: jest.fn(() => ({ + id: 1, + name: "Pool 1", + symbol: "P1", + manager: (0, utils_1.makeAddress)("MANAGER"), + strategy: (0, utils_1.makeAddress)("STRATEGY"), + baseFee: 0, + percentFee: 0, + treasury: (0, utils_1.makeAddress)("TREASURY"), + })), + getFeeDenominator: jest.fn(() => 100), + }, + }; + }) }))); +describe("Allo", () => { + let allo; + beforeEach(() => { + allo = new Allo_1.Allo({ chain: 5 }); + }); + // Test cases for view functions + describe("View Functions", () => { + it("should return if the address is a pool admin", () => __awaiter(void 0, void 0, void 0, function* () { + const isAdmin = yield allo.isPoolAdmin(1, (0, utils_1.makeAddress)("ADMIN")); + expect(isAdmin).toEqual(true); + })); + it("should return if the address is a pool manager", () => __awaiter(void 0, void 0, void 0, function* () { + const isManager = yield allo.isPoolManager(1, (0, utils_1.makeAddress)("MANAGER")); + expect(isManager).toEqual(true); + })); + it("should get if the strategy is cloneable", () => __awaiter(void 0, void 0, void 0, function* () { + const isCloneable = yield allo.isCloneableStrategy(); + expect(isCloneable).toEqual(true); + })); + it("should get the strategy", () => __awaiter(void 0, void 0, void 0, function* () { + const strategy = yield allo.getStrategy(1); + expect(strategy).toEqual((0, utils_1.makeAddress)("STRATEGY")); + })); + it("should get fee percentage", () => __awaiter(void 0, void 0, void 0, function* () { + const percentFee = yield allo.getPercentFee(); + expect(percentFee).toEqual(0); + })); + it("should get the base fee", () => __awaiter(void 0, void 0, void 0, function* () { + const baseFee = yield allo.getBaseFee(); + expect(baseFee).toEqual(0); + })); + it("should get the treasury", () => __awaiter(void 0, void 0, void 0, function* () { + const treasury = yield allo.getTreasury(); + expect(treasury).toEqual((0, utils_1.makeAddress)("TREASURY")); + })); + it("should get the registry", () => __awaiter(void 0, void 0, void 0, function* () { + const registry = yield allo.getRegistry(); + expect(registry).toEqual((0, utils_1.makeAddress)("REGISTRY")); + })); + it("should get the pool", () => __awaiter(void 0, void 0, void 0, function* () { + const pool = yield allo.getPool(1); + expect(pool).toEqual({ + id: 1, + name: "Pool 1", + symbol: "P1", + manager: (0, utils_1.makeAddress)("MANAGER"), + strategy: (0, utils_1.makeAddress)("STRATEGY"), + baseFee: 0, + percentFee: 0, + treasury: (0, utils_1.makeAddress)("TREASURY"), + }); + })); + it("should get the fee denominator", () => __awaiter(void 0, void 0, void 0, function* () { + const feeDenominator = yield allo.getFeeDenominator(); + expect(feeDenominator).toEqual(100); + })); + }); + // Test cases for write functions + describe("Write Functions", () => { + it("should create a pool", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.createPool({ + profileId: (0, utils_1.makeBytes32)("PROFILE"), + strategy: (0, utils_1.makeAddress)("STRATEGY"), + initStrategyData: "0x", + token: (0, utils_1.makeAddress)("TOKEN"), + amount: BigInt(0), + metadata: metadata, + managers: [(0, utils_1.makeAddress)("MANAGER")], + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should create a pool with custom strategy", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.createPoolWithCustomStrategy({ + profileId: (0, utils_1.makeBytes32)("PROFILE"), + strategy: (0, utils_1.makeAddress)("STRATEGY"), + initStrategyData: "0x", + token: (0, utils_1.makeAddress)("TOKEN"), + amount: BigInt(0), + metadata, + managers: [(0, utils_1.makeAddress)("MANAGER")], + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the pool metadata", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.updatePoolMetadata({ + poolId: 1, + metadata: { + protocol: BigInt(1), + pointer: "bafybeia4khbew3r2mkfly23nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", + }, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the registry address", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.updateRegistry((0, utils_1.makeAddress)("REGISTRY")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the treasury address", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.updateTreasury((0, utils_1.makeAddress)("TREASURY")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the percent fee", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.updatePercentFee(1); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the base fee", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.updateBaseFee(1); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should add strategy to cloneable strategies", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.addToCloneableStrategies((0, utils_1.makeAddress)("STRATEGY2")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should remove strategy to cloneable strategies", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.removeFromCloneableStrategies((0, utils_1.makeAddress)("STRATEGY2")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should add pool manager", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.addPoolManager(1, (0, utils_1.makeAddress)("MANAGER2")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should remove pool manager", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.removePoolManager(1, (0, utils_1.makeAddress)("MANAGER2")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should recover funds", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.recoverFunds((0, utils_1.makeAddress)("TOKEN"), (0, utils_1.makeAddress)("RECIPIENT")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + }); + // Test cases for strategy functions + describe("Strategy Functions", () => { + it("should register a recipient", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.registerRecipient(1, (0, utils_1.makeBytes32)("STRATEGY_DATA")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should batch register multiple recipients", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.batchRegisterRecipient([1, 1], [(0, utils_1.makeBytes32)("STRATEGY_DATA"), (0, utils_1.makeBytes32)("STRATEGY_DATA")]); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should fund a pool", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.fundPool(1, 100e18); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should allocate to a recipient", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.allocate(1, (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should batch allocate to multiple recipients", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.batchAllocate([1, 1], [ + (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA"), + (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA"), + ]); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should distribute funds", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = allo.distribute(1, [(0, utils_1.makeAddress)("RECIPIENT1"), (0, utils_1.makeAddress)("RECIPIENT2")], (0, utils_1.makeBytes32)("STRATEGY_DISTRIBUTE_DATA")); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + }); +}); diff --git a/dist/__tests__ignore/Registry/Registry.test.d.ts b/dist/__tests__ignore/Registry/Registry.test.d.ts new file mode 100644 index 0000000..1cab1d1 --- /dev/null +++ b/dist/__tests__ignore/Registry/Registry.test.d.ts @@ -0,0 +1,2 @@ +import { Metadata } from "../../Common/types"; +export declare const metadata: Metadata; diff --git a/dist/__tests__ignore/Registry/Registry.test.js b/dist/__tests__ignore/Registry/Registry.test.js new file mode 100644 index 0000000..1d3bb43 --- /dev/null +++ b/dist/__tests__ignore/Registry/Registry.test.js @@ -0,0 +1,210 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.metadata = void 0; +const Registry_1 = require("../../Registry/Registry"); +const utils_1 = require("../utils/utils"); +const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; +exports.metadata = { + protocol: BigInt(1), + pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", +}; +jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { + return { + read: { + ALLO_OWNER: jest.fn(() => (0, utils_1.makeAddress)("ALLO_OWNER")), + DEFAULT_ADMIN_ROLE: jest.fn(() => (0, utils_1.makeBytes32)("DEFAULT_ADMIN_ROLE")), + NATIVE: jest.fn(() => (0, utils_1.NATIVE)()), + anchorToProfileId: jest.fn(([anchor]) => (0, utils_1.makeBytes32)(anchor)), + getProfileByAnchor: jest.fn(([anchor]) => (0, utils_1.makeBytes32)(anchor)), + getProfileById: jest.fn(([profileId]) => (0, utils_1.makeBytes32)(profileId)), + getRoleAdmin: jest.fn(([role]) => (0, utils_1.makeBytes32)(role)), + hasRole: jest.fn(() => true), + isMemberOfProfile: jest.fn(() => true), + isOwnerOfProfile: jest.fn(() => true), + isOwnerOrMemberOfProfile: jest.fn(() => true), + profileIdToPendingOwner: jest.fn(() => (0, utils_1.makeBytes32)("profileId")), + }, + }; + }) }))); +describe("Registry", () => { + let registry; + beforeEach(() => { + registry = new Registry_1.Registry({ chain: 5 }); + }); + // Test cases for view functions + describe("View Functions", () => { + it("should get ALLO_OWNER", () => __awaiter(void 0, void 0, void 0, function* () { + const allowOwner = yield registry.getAlloOwner(); + expect(allowOwner).toEqual((0, utils_1.makeAddress)("ALLO_OWNER")); + })); + it("should get DEFAULT_ADMIN_ROLE", () => __awaiter(void 0, void 0, void 0, function* () { + const defaultAdminRole = yield registry.getDefaultAdminRole(); + expect(defaultAdminRole).toEqual((0, utils_1.makeBytes32)("DEFAULT_ADMIN_ROLE")); + })); + it("should get NATIVE", () => __awaiter(void 0, void 0, void 0, function* () { + const native = yield registry.getNative(); + expect(native).toEqual((0, utils_1.NATIVE)()); + })); + it("should get anchorToProfileId", () => __awaiter(void 0, void 0, void 0, function* () { + const anchor = (0, utils_1.makeAddress)("anchor"); + const anchorToProfileId = yield registry.getAnchorToProfileId(anchor); + expect(anchorToProfileId).toEqual((0, utils_1.makeBytes32)(anchor)); + })); + it("should get profile by anchor", () => __awaiter(void 0, void 0, void 0, function* () { + const anchor = (0, utils_1.makeAddress)("anchor"); + const profile = yield registry.getProfileByAnchor(anchor); + expect(profile).toEqual((0, utils_1.makeBytes32)(anchor)); + })); + it("should get profile by id", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const profile = yield registry.getProfileById(profileId); + expect(profile).toEqual((0, utils_1.makeBytes32)(profileId)); + })); + it("should get the admin role", () => __awaiter(void 0, void 0, void 0, function* () { + const adminRole = yield registry.getRoleAdmin("role"); + expect(adminRole).toEqual((0, utils_1.makeBytes32)("role")); + })); + it("should check if an account has a role", () => __awaiter(void 0, void 0, void 0, function* () { + const hasRole = yield registry.hasRole({ + role: "role", + account: (0, utils_1.makeAddress)("account"), + }); + expect(hasRole).toEqual(true); + })); + it("should check if an account is a owner of a profile", () => __awaiter(void 0, void 0, void 0, function* () { + const isOwner = yield registry.isOwnerOfProfile({ + profileId: (0, utils_1.makeBytes32)("profileId"), + account: (0, utils_1.makeAddress)("account"), + }); + expect(isOwner).toEqual(true); + })); + it("should check if an account is a member or an owner of a profile", () => __awaiter(void 0, void 0, void 0, function* () { + const isOwnerOrMember = yield registry.isOwnerOrMemberOfProfile({ + profileId: (0, utils_1.makeBytes32)("profileId"), + account: (0, utils_1.makeAddress)("account"), + }); + expect(isOwnerOrMember).toEqual(true); + })); + it("should get the pending owner for a profile id", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = yield registry.profileIdToPendingOwner((0, utils_1.makeBytes32)("pendingOwner")); + expect(profileId).toEqual((0, utils_1.makeBytes32)("profileId")); + })); + }); + // Test cases for write functions + describe("Write Functions", () => { + // Test cases for write functions + it("should create a profile", () => __awaiter(void 0, void 0, void 0, function* () { + const nonce = 1; + const name = "my secret profile"; + const metatdata = { + protocol: BigInt(1), + pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", + }; + const owner = (0, utils_1.makeAddress)("owner"); + const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; + const tx = yield registry.createProfile({ + nonce, + name, + metadata: metatdata, + owner, + members, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should accept profile ownership", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const tx = registry.acceptProfileOwnership(profileId); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should accept profile ownership", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const tx = yield registry.acceptProfileOwnership(profileId); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should add a member to a profile", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; + const tx = yield registry.addMembers({ + profileId, + members, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should remove a member from a profile", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; + const tx = registry.removeMembers({ + profileId, + members, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update profile metadata", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const tx = registry.updateProfileMetadata({ + profileId, + metadata: exports.metadata, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update profile name", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const name = "my secret profile updated"; + const tx = registry.updateProfileName({ + profileId, + name, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update profile pending owner", () => __awaiter(void 0, void 0, void 0, function* () { + const profileId = (0, utils_1.makeBytes32)("profileId"); + const pendingOwner = (0, utils_1.makeAddress)("pendingOwner"); + const tx = registry.updateProfilePendingOwner({ + profileId, + account: pendingOwner, + }); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + }); +}); diff --git a/dist/__tests__ignore/Strategy/DonationVoting.test.d.ts b/dist/__tests__ignore/Strategy/DonationVoting.test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/__tests__ignore/Strategy/DonationVoting.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/__tests__ignore/Strategy/DonationVoting.test.js b/dist/__tests__ignore/Strategy/DonationVoting.test.js new file mode 100644 index 0000000..daec242 --- /dev/null +++ b/dist/__tests__ignore/Strategy/DonationVoting.test.js @@ -0,0 +1,317 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("../utils/utils"); +const DonationVotingMerkleDistribution_1 = require("../../strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution"); +const alloAddress = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; +const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; +jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { + return { + read: { + NATIVE: jest.fn(() => (0, utils_1.NATIVE)()), + PERMIT2: jest.fn(() => (0, utils_1.makeBytes32)("PERMIT2")), + allocationEndTime: jest.fn(() => 1), + allocationStartTime: jest.fn(() => 1), + allowedTokens: jest.fn(() => true), + claims: jest.fn(() => 0), + getClaims: jest.fn(() => 0), + distributionMetadata: jest.fn(() => ({ + protocol: BigInt(1), + pointer: "unt93847nwg[u7456w7shn56", + })), + distributionStarted: jest.fn(() => true), + getAllo: jest.fn(() => alloAddress), + getPayouts: jest.fn(() => []), + getPoolAmount: jest.fn(() => 0), + getPoolId: jest.fn(() => 0), + getRecipient: jest.fn(() => ({ + recipientId: (0, utils_1.makeAddress)("RECIPIENT1"), + })), + getRecipientStatus: jest.fn(() => 1), + getStrategyId: jest.fn(() => address), + hasBeenDistributed: jest.fn(() => true), + isDistributionSet: jest.fn(() => true), + isPoolActive: jest.fn(() => true), + isValidAllocator: jest.fn(() => true), + merkleRoot: jest.fn(() => "unt93847nwg[u7456w7shn56"), + metadataRequired: jest.fn(() => true), + recipientToStatusIndexes: jest.fn(() => []), + recipientsCounter: jest.fn(() => 0), + registrationStartTime: jest.fn(() => 1), + registrationEndTime: jest.fn(() => 1), + statusesBitMap: jest.fn(() => 0), + totalPayoutAmount: jest.fn(() => 1e18), + useRegistryAnchor: jest.fn(() => true), + }, + }; + }) }))); +describe("DonationVotingMerkleDistributionStrategy", () => { + let strategy; + beforeEach(() => { + strategy = new DonationVotingMerkleDistribution_1.DonationVotingMerkleDistributionStrategy({ + chain: 5, + rpc: "rpc", + address: address, + }); + }); + describe("read functions", () => { + it("should return the native token address", () => __awaiter(void 0, void 0, void 0, function* () { + const native = yield strategy.getNative(); + expect(native).toEqual((0, utils_1.NATIVE)()); + })); + it("should return the permit2 token", () => __awaiter(void 0, void 0, void 0, function* () { + const permit2 = yield strategy.getPermit2(); + expect(permit2).toEqual((0, utils_1.makeBytes32)("PERMIT2")); + })); + it("should return the allocation end time", () => __awaiter(void 0, void 0, void 0, function* () { + const endTime = yield strategy.getAllocationEndTime(); + expect(endTime).toEqual(1); + })); + it("should return the allocation start time", () => __awaiter(void 0, void 0, void 0, function* () { + const startTime = yield strategy.getAllocationStartTime(); + expect(startTime).toEqual(1); + })); + it("should get the allowed tokens", () => __awaiter(void 0, void 0, void 0, function* () { + const allowed = yield strategy.isAllowedTokens((0, utils_1.NATIVE)()); + expect(allowed).toEqual(true); + })); + it("should return the claims", () => __awaiter(void 0, void 0, void 0, function* () { + const claims = yield strategy.getClaims(address, (0, utils_1.NATIVE)()); + expect(claims).toEqual(0); + })); + it("should return distribution metadata", () => __awaiter(void 0, void 0, void 0, function* () { + const metadata = yield strategy.getDistributionMetadata(); + expect(metadata).toEqual({ + protocol: BigInt(1), + pointer: "unt93847nwg[u7456w7shn56", + }); + })); + it("should return if the distribution has started", () => __awaiter(void 0, void 0, void 0, function* () { + const isStarted = yield strategy.getDistributionStarted(); + expect(isStarted).toEqual(true); + })); + it("should return the allo address", () => __awaiter(void 0, void 0, void 0, function* () { + const allo = yield strategy.getAllo(); + expect(allo).toEqual(alloAddress); + })); + it("should get the payouts", () => __awaiter(void 0, void 0, void 0, function* () { + const recipientIds = [ + (0, utils_1.makeAddress)("RECIPIENT1"), + (0, utils_1.makeAddress)("RECIPIENT2"), + ]; + const payoutData = [ + (0, utils_1.makeBytes32)("PAYOUT_DATA"), + (0, utils_1.makeBytes32)("PAYOUT_DATA2"), + ]; + const payouts = yield strategy.getPayouts(recipientIds, payoutData); + expect(payouts).toEqual([]); + })); + it("should get the pool amount", () => __awaiter(void 0, void 0, void 0, function* () { + const poolAmount = yield strategy.getPoolAmount(); + expect(poolAmount).toEqual(0); + })); + it("should get the pool ID", () => __awaiter(void 0, void 0, void 0, function* () { + const poolId = yield strategy.getPoolId(); + expect(poolId).toEqual(0); + })); + it("should get the recipient", () => __awaiter(void 0, void 0, void 0, function* () { + const recipientId = (0, utils_1.makeAddress)("RECIPIENT1"); + const recipient = yield strategy.getRecipient(recipientId); + expect(recipient).toEqual({ + recipientId: (0, utils_1.makeAddress)("RECIPIENT1"), + }); + })); + it("should get the recipient status", () => __awaiter(void 0, void 0, void 0, function* () { + const recipientId = (0, utils_1.makeAddress)("RECIPIENT1"); + const status = yield strategy.getRecipientStatus(recipientId); + expect(status).toEqual(1); + })); + it("should get the strategy ID", () => __awaiter(void 0, void 0, void 0, function* () { + const strategyId = yield strategy.getStrategyId(); + expect(strategyId).toEqual(address); + })); + it("should call hasBeenDistributed()", () => __awaiter(void 0, void 0, void 0, function* () { + const hasBeenDistributed = yield strategy.hasBeenDistributed(0); + expect(hasBeenDistributed).toEqual(true); + })); + it("should return if a distribution is set", () => __awaiter(void 0, void 0, void 0, function* () { + const isSet = yield strategy.isDistributionSet(); + expect(isSet).toEqual(true); + })); + it("should return if a pool is active", () => __awaiter(void 0, void 0, void 0, function* () { + const isActive = yield strategy.isPoolActive(); + expect(isActive).toEqual(true); + })); + it("should return if a valid allocator", () => __awaiter(void 0, void 0, void 0, function* () { + const isAllocator = yield strategy.isValidAllocator(address); + expect(isAllocator).toEqual(true); + })); + it("should get the merkle root", () => __awaiter(void 0, void 0, void 0, function* () { + const root = yield strategy.getMerkleRoot(); + expect(root).toEqual("unt93847nwg[u7456w7shn56"); + })); + it("should return if metadata is required", () => __awaiter(void 0, void 0, void 0, function* () { + const isRequired = yield strategy.metadataRequired(); + expect(isRequired).toEqual(true); + })); + it("should return the recipient to status index", () => __awaiter(void 0, void 0, void 0, function* () { + const indexes = yield strategy.recipientToStatusIndexes((0, utils_1.makeAddress)("RECIPIENT1")); + expect(indexes).toEqual([]); + })); + it("should return the recipients counter", () => __awaiter(void 0, void 0, void 0, function* () { + const counter = yield strategy.recipientsCounter(); + expect(counter).toEqual(0); + })); + it("should return the registration start time", () => __awaiter(void 0, void 0, void 0, function* () { + const startTime = yield strategy.registrationStartTime(); + expect(startTime).toEqual(1); + })); + it("should return the registration end time", () => __awaiter(void 0, void 0, void 0, function* () { + const endTime = yield strategy.registrationEndTime(); + expect(endTime).toEqual(1); + })); + it("should return the statuses bitmap", () => __awaiter(void 0, void 0, void 0, function* () { + const bitmap = yield strategy.statusesBitMap(0); + expect(bitmap).toEqual(0); + })); + it("should return the total payout amount", () => __awaiter(void 0, void 0, void 0, function* () { + const amount = yield strategy.totalPayoutAmount(); + expect(amount).toEqual(1e18); + })); + it("should return whether to use the registry anchor", () => __awaiter(void 0, void 0, void 0, function* () { + const useAnchor = yield strategy.useRegistryAnchor(); + expect(useAnchor).toEqual(true); + })); + }); + describe("write functions", () => { + it("should allocate", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = strategy.allocate((0, utils_1.makeBytes32)("ALLOCATE_DATA")); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should batch allocate", () => __awaiter(void 0, void 0, void 0, function* () { + const data = [ + (0, utils_1.makeBytes32)("ALLOCATE_DATA"), + (0, utils_1.makeBytes32)("ALLOCATE_DATA2"), + ]; + const tx = strategy.batchAllocate(data); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should register a recipient", () => __awaiter(void 0, void 0, void 0, function* () { + const data = (0, utils_1.makeBytes32)("REGISTER_DATA"); + const tx = strategy.registerRecipient(data); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should batch register recipients", () => __awaiter(void 0, void 0, void 0, function* () { + const data = [ + (0, utils_1.makeBytes32)("REGISTER_DATA"), + (0, utils_1.makeBytes32)("REGISTER_DATA2"), + ]; + const tx = strategy.batchRegisterRecipient(data); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should fund the pool", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = strategy.fundPool(100e18); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should distribute funds to recipients", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = strategy.distribute([address, address], (0, utils_1.makeBytes32)("DISTRIBUTE_DATA")); + expect(tx).toEqual({ + to: alloAddress, + data: tx.data, + value: "0", + }); + })); + it("should claim funds", () => __awaiter(void 0, void 0, void 0, function* () { + const data = [ + { recipientId: (0, utils_1.makeAddress)("CLAIMANT1"), token: (0, utils_1.NATIVE)() }, + { recipientId: (0, utils_1.makeAddress)("CLAIMANT2"), token: (0, utils_1.NATIVE)() }, + ]; + const tx = strategy.claim(data); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should call multicall", () => __awaiter(void 0, void 0, void 0, function* () { + const data = [ + (0, utils_1.makeBytes32)("MULTICALL_DATA"), + (0, utils_1.makeBytes32)("MULTICALL_DATA2"), + ]; + const tx = strategy.multicall(data); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should review recipients", () => __awaiter(void 0, void 0, void 0, function* () { + const data = [ + { index: 1, statusRow: 1 }, + { index: 2, statusRow: 2 }, + ]; + const tx = strategy.reviewRecipients(data); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the distribution", () => __awaiter(void 0, void 0, void 0, function* () { + const distributeMetadata = { + protocol: BigInt(1), + pointer: "unt93847nwg[u7456w7shn56", + }; + const tx = strategy.updateDistribution((0, utils_1.makeBytes32)("MERKLE_ROOT"), distributeMetadata); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should update the pool timestamps", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = strategy.updatePoolTimestamps(1000, 2000, 3000, 4000); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + it("should withdraw the funds from the pool", () => __awaiter(void 0, void 0, void 0, function* () { + const tx = strategy.withdraw(1e18); + expect(tx).toEqual({ + to: address, + data: tx.data, + value: "0", + }); + })); + }); +}); diff --git a/dist/__tests__ignore/Strategy/MicroGrants.test.d.ts b/dist/__tests__ignore/Strategy/MicroGrants.test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/__tests__ignore/Strategy/MicroGrants.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/__tests__ignore/Strategy/MicroGrants.test.js b/dist/__tests__ignore/Strategy/MicroGrants.test.js new file mode 100644 index 0000000..356f910 --- /dev/null +++ b/dist/__tests__ignore/Strategy/MicroGrants.test.js @@ -0,0 +1,74 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const MicroGrantsStrategy_1 = require("../../strategies/MicroGrantsStrategy/MicroGrantsStrategy"); +const utils_1 = require("../utils/utils"); +// const alloAddress: Address = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; +const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; +jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { + return { + read: { + NATIVE: jest.fn(() => utils_1.NATIVE), + allocationStartTime: jest.fn(() => 1), + allocationEndTime: jest.fn(() => 1), + maxRequestedAmountAllowed: jest.fn(() => 0), + approvalThreshold: jest.fn(() => 0), + allocators: jest.fn(() => true), + allocated: jest.fn(() => true), + recipientAllocations: jest.fn(() => 0), + }, + }; + }) }))); +describe("Micro Grants Strategy", () => { + let strategy; + beforeEach(() => { + strategy = new MicroGrantsStrategy_1.MicroGrantsStrategy({ + chain: 5, + rpc: "rpc", + address, + poolId: 0, + }); + }); + describe("read functions", () => { + it("should return the native token address", () => __awaiter(void 0, void 0, void 0, function* () { + const native = yield strategy.getNative(); + expect(native).toEqual(utils_1.NATIVE); + })); + it("should return the allocation start time", () => __awaiter(void 0, void 0, void 0, function* () { + const startTime = yield strategy.allocationStartTime(); + expect(startTime).toEqual(1); + })); + it("should return the allocation end time", () => __awaiter(void 0, void 0, void 0, function* () { + const endTime = yield strategy.allocationEndTime(); + expect(endTime).toEqual(1); + })); + it("should return the max requested amount", () => __awaiter(void 0, void 0, void 0, function* () { + const maxRequestedAmount = yield strategy.maxRequestedAmount(); + expect(maxRequestedAmount).toEqual(0); + })); + it("should return the approval threshold", () => __awaiter(void 0, void 0, void 0, function* () { + const approvalThreshold = yield strategy.approvalThreshold(); + expect(approvalThreshold).toEqual(0); + })); + it("should return the allocators", () => __awaiter(void 0, void 0, void 0, function* () { + const allocators = yield strategy.allocator("allocator"); + expect(allocators).toEqual(true); + })); + it("should return the allocated", () => __awaiter(void 0, void 0, void 0, function* () { + const allocated = yield strategy.allocated("allocator", "recipient"); + expect(allocated).toEqual(true); + })); + it("should return the recipient allocations", () => __awaiter(void 0, void 0, void 0, function* () { + const recipientAllocations = yield strategy.recipientAllocations("recipient", 0); + expect(recipientAllocations).toEqual(0); + })); + }); +}); diff --git a/dist/__tests__ignore/utils/utils.d.ts b/dist/__tests__ignore/utils/utils.d.ts new file mode 100644 index 0000000..129b07b --- /dev/null +++ b/dist/__tests__ignore/utils/utils.d.ts @@ -0,0 +1,3 @@ +export declare const makeAddress: (input: string) => string; +export declare const makeBytes32: (input: string) => string; +export declare const NATIVE: () => string; diff --git a/dist/__tests__ignore/utils/utils.js b/dist/__tests__ignore/utils/utils.js new file mode 100644 index 0000000..2d5ead4 --- /dev/null +++ b/dist/__tests__ignore/utils/utils.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NATIVE = exports.makeBytes32 = exports.makeAddress = void 0; +const viem_1 = require("viem"); +const makeAddress = (input) => { + return (0, viem_1.keccak256)((0, viem_1.toHex)(input)).slice(0, 42); +}; +exports.makeAddress = makeAddress; +const makeBytes32 = (input) => { + return (0, viem_1.keccak256)((0, viem_1.toHex)(input)); +}; +exports.makeBytes32 = makeBytes32; +const NATIVE = () => { + return "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; +}; +exports.NATIVE = NATIVE; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.d.ts b/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.d.ts index 8d547c4..09d13cc 100644 --- a/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.d.ts +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.d.ts @@ -1,19 +1,25 @@ -import { ConstructorArgs, Metadata, TransactionData } from "../../Common/types"; +import { ConstructorArgs, DeployParams, Metadata, TransactionData } from "../../Common/types"; import { PayoutSummary, Status } from "../types"; -import { Recipient } from "./types"; +import { Distribution, InitializeParamsDonationVoting, Permit2Data, Recipient, RegisterDataDonationVoting } from "./types"; export declare class DonationVotingMerkleDistributionStrategy { private client; private contract; private strategy; private poolId; private allo; - constructor({ chain, rpc, address }: ConstructorArgs); + constructor({ chain, rpc, address, poolId }: ConstructorArgs); + setPoolId(poolId: number): Promise; + setContract(address: `0x${string}`): void; + private checkPoolId; + private checkStrategy; + getInitializeData(params: InitializeParamsDonationVoting): Promise<`0x${string}`>; + getDeployParams(strategyType: string): DeployParams; getNative(): Promise; getPermit2(): Promise; getAllocationEndTime(): Promise; getAllocationStartTime(): Promise; - isAllowedTokens(token: string): Promise; - getClaims(recipient: string, token: string): Promise; + getIsAllowedToken(token: string): Promise; + getClaim(recipient: string, token: string): Promise; getDistributionMetadata(): Promise; getDistributionStarted(): Promise; getAllo(): Promise; @@ -23,25 +29,24 @@ export declare class DonationVotingMerkleDistributionStrategy { getRecipient(recipientId: string): Promise; getRecipientStatus(recipientId: string): Promise; getStrategyId(): Promise; - hasBeenDistributed(index: number): Promise; - isDistributionSet(): Promise; - isPoolActive(): Promise; - isValidAllocator(allocator: `0x${string}`): Promise; + getHasBeenDistributed(index: number): Promise; + getIsDistributionSet(): Promise; + getIsPoolActive(): Promise; + getIsValidAllocator(allocator: `0x${string}`): Promise; getMerkleRoot(): Promise; - metadataRequired(): Promise; - recipientToStatusIndexes(recipient: string): Promise; - recipientsCounter(): Promise; - registrationEndTime(): Promise; - registrationStartTime(): Promise; - statusesBitMap(index: number): Promise; - totalPayoutAmount(): Promise; + getMetadataRequired(): Promise; + getRecipientToStatusIndexes(recipient: string): Promise; + getRecipientsCounter(): Promise; + getRegistrationEndTime(): Promise; + getRegistrationStartTime(): Promise; + getStatusAtIndex(index: number): Promise; + getTotalPayoutAmount(): Promise; useRegistryAnchor(): Promise; - allocate(strategyData: string): TransactionData; - batchAllocate(strategyData: string[]): TransactionData; - registerRecipient(strategyData: string): TransactionData; - batchRegisterRecipient(strategyData: string[]): TransactionData; - fundPool(amount: number): TransactionData; - distribute(recipientIds: string[], data: string): TransactionData; + getAllocationData(data: Permit2Data, ethAmount?: bigint): TransactionData; + getBatchAllocationData(data: Permit2Data[], ethAmount?: bigint): TransactionData; + getRegisterRecipientData(data: RegisterDataDonationVoting): TransactionData; + getBatchRegisterRecipientData(data: RegisterDataDonationVoting[]): TransactionData; + distribute(data: Distribution[]): TransactionData; claim(claims: { recipientId: string; token: string; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.js b/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.js index 1b28fb0..83c3ea4 100644 --- a/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.js +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.js @@ -12,84 +12,148 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.DonationVotingMerkleDistributionStrategy = void 0; const viem_1 = require("viem"); const Client_1 = require("../../Client/Client"); -const donationVoting_config_1 = require("./donationVoting.config"); const Allo_1 = require("../../Allo/Allo"); +const types_1 = require("./types"); const chains_config_1 = require("../../chains.config"); +const donationVotingVault_config_1 = require("./donationVotingVault.config"); +const donationVotingDirect_config_1 = require("./donationVotingDirect.config"); +const allo_config_1 = require("../../Allo/allo.config"); class DonationVotingMerkleDistributionStrategy { - constructor({ chain, rpc, address }) { + constructor({ chain, rpc, address, poolId }) { const usedChain = (0, viem_1.extractChain)({ chains: chains_config_1.supportedChains, id: chain, }); this.client = (0, Client_1.create)(usedChain, rpc); - if (!address) - throw new Error("DonationVotingMerkleDistributionStrategy: No strategy address provided"); - this.strategy = address; this.allo = new Allo_1.Allo({ chain, rpc }); // to call allocate + if (address) { + this.strategy = address; + this.contract = (0, viem_1.getContract)({ + address: address, + abi: donationVotingVault_config_1.abi, + publicClient: this.client, + }); + } + this.poolId = poolId || -1; + } + setPoolId(poolId) { + return __awaiter(this, void 0, void 0, function* () { + this.poolId = poolId; + const strategyAddress = yield this.allo.getStrategy(poolId); + this.setContract(strategyAddress); + }); + } + setContract(address) { this.contract = (0, viem_1.getContract)({ address: address, - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, publicClient: this.client, }); - this.poolId = 0; // TODO: set poolId + this.strategy = address; + } + checkPoolId() { + if (this.poolId === -1) + throw new Error("DonationVotingMerkleDistributionStrategy: No poolId provided. Please call `setPoolId` first."); + } + checkStrategy() { + if (!this.strategy) + throw new Error("DonationVotingMerkleDistributionStrategy: No strategy address provided. Please call `setContract` first."); + } + // Init and Deploy + getInitializeData(params) { + return __awaiter(this, void 0, void 0, function* () { + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("bool, bool, uint64, uint64, uint64, uint64, address[]"), [ + params.useRegistryAnchor, + params.metadataRequired, + params.registrationStartTime, + params.registrationEndTime, + params.allocationStartTime, + params.allocationEndTime, + params.allowedTokens, + ]); + return encoded; + }); + } + getDeployParams(strategyType) { + const constructorArgs = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, string"), [this.allo.address(), strategyType]); + const constructorArgsNo0x = constructorArgs.slice(2); + // create the proper bytecode + const bytecode = strategyType === types_1.StrategyTypeDonationVoting.Vault + ? donationVotingVault_config_1.bytecode + : donationVotingDirect_config_1.bytecode; + const abi = strategyType === types_1.StrategyTypeDonationVoting.Vault ? donationVotingVault_config_1.abi : donationVotingDirect_config_1.abi; + return { + abi: abi, + bytecode: (bytecode + constructorArgsNo0x), + }; } // Read only functions getNative() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const native = yield this.contract.read.NATIVE(); return native; }); } getPermit2() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const permit2 = yield this.contract.read.PERMIT2(); return permit2; }); } getAllocationEndTime() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const endTime = yield this.contract.read.allocationEndTime(); return endTime; }); } getAllocationStartTime() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const startTime = yield this.contract.read.allocationStartTime(); return startTime; }); } - isAllowedTokens(token) { + getIsAllowedToken(token) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const allowed = yield this.contract.read.allowedTokens(token); return allowed; }); } - getClaims(recipient, token) { + getClaim(recipient, token) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const claims = yield this.contract.read.claims([recipient, token]); return claims; }); } getDistributionMetadata() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const metadata = yield this.contract.read.distributionMetadata(); return metadata; }); } getDistributionStarted() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const started = yield this.contract.read.distributionStarted(); return started; }); } getAllo() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const allo = yield this.contract.read.getAllo(); return allo; }); } getPayouts(recipientIds, data) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const payouts = yield this.contract.read.getPayouts([recipientIds, data]); const payoutSummary = payouts.map((payout) => { return { @@ -102,139 +166,243 @@ class DonationVotingMerkleDistributionStrategy { } getPoolAmount() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const amount = yield this.contract.read.getPoolAmount(); return amount; }); } getPoolId() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const id = yield this.contract.read.getPoolId(); return id; }); } getRecipient(recipientId) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const recipient = yield this.contract.read.getRecipient([recipientId]); return recipient; }); } getRecipientStatus(recipientId) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const status = yield this.contract.read.getRecipientStatus([recipientId]); return status; }); } getStrategyId() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const id = yield this.contract.read.getStrategyId(); return id; }); } - hasBeenDistributed(index) { + getHasBeenDistributed(index) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const distributed = yield this.contract.read.hasBeenDistributed([index]); return distributed; }); } - isDistributionSet() { + getIsDistributionSet() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const set = yield this.contract.read.isDistributionSet(); return set; }); } - isPoolActive() { + getIsPoolActive() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const active = yield this.contract.read.isPoolActive(); return active; }); } - isValidAllocator(allocator) { + getIsValidAllocator(allocator) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const valid = yield this.contract.read.isValidAllocator([allocator]); return valid; }); } getMerkleRoot() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const root = yield this.contract.read.merkleRoot(); return root; }); } - metadataRequired() { + getMetadataRequired() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const required = yield this.contract.read.metadataRequired(); return required; }); } - recipientToStatusIndexes(recipient) { + getRecipientToStatusIndexes(recipient) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const indexes = yield this.contract.read.recipientToStatusIndexes([ recipient, ]); return indexes; }); } - recipientsCounter() { + getRecipientsCounter() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const counter = yield this.contract.read.recipientsCounter(); return counter; }); } - registrationEndTime() { + getRegistrationEndTime() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const endTime = yield this.contract.read.registrationEndTime(); return endTime; }); } - registrationStartTime() { + getRegistrationStartTime() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const startTime = yield this.contract.read.registrationStartTime(); return startTime; }); } - statusesBitMap(index) { + getStatusAtIndex(index) { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const bitMap = yield this.contract.read.statusesBitMap([index]); return bitMap; }); } - totalPayoutAmount() { + getTotalPayoutAmount() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const amount = yield this.contract.read.totalPayoutAmount(); return amount; }); } useRegistryAnchor() { return __awaiter(this, void 0, void 0, function* () { + this.checkStrategy(); const anchor = yield this.contract.read.useRegistryAnchor(); return anchor; }); } // Callable by allo client - allocate(strategyData) { - return this.allo.allocate(this.poolId, strategyData); - } - batchAllocate(strategyData) { - const poolIds = Array(strategyData.length).fill(this.poolId); - return this.allo.batchAllocate(poolIds, strategyData); + getAllocationData(data, ethAmount) { + this.checkPoolId(); + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("((address, uint256), uint256, uint256), bytes32"), [ + [ + [data.permit.permitted.token, data.permit.permitted.amount], + data.permit.nonce, + data.permit.deadline, + ], + data.signature, + ]); + const encodedData = (0, viem_1.encodeFunctionData)({ + abi: allo_config_1.abi, + functionName: "allocate", + args: [this.poolId, encoded], + }); + return { + to: this.allo.address(), + data: encodedData, + value: ethAmount ? ethAmount.toString() : "0", + }; } - registerRecipient(strategyData) { - return this.allo.registerRecipient(this.poolId, strategyData); + getBatchAllocationData(data, ethAmount) { + this.checkPoolId(); + const encodedParams = []; + data.forEach((allocation) => { + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("((address, uint256), uint256, uint256), bytes32"), [ + [ + [ + allocation.permit.permitted.token, + allocation.permit.permitted.amount, + ], + allocation.permit.nonce, + allocation.permit.deadline, + ], + allocation.signature, + ]); + encodedParams.push(encoded); + }); + const poolIds = Array(encodedParams.length).fill(this.poolId); + const encodedData = (0, viem_1.encodeFunctionData)({ + abi: allo_config_1.abi, + functionName: "batchAllocate", + args: [poolIds, encodedParams], + }); + return { + to: this.allo.address(), + data: encodedData, + value: ethAmount ? ethAmount.toString() : "0", + }; } - batchRegisterRecipient(strategyData) { - const poolIds = Array(strategyData.length).fill(this.poolId); - return this.allo.batchRegisterRecipient(poolIds, strategyData); + getRegisterRecipientData(data) { + this.checkPoolId(); + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, (uint256, string)"), [ + data.registryAnchor, + data.recipientAddress, + [data.metadata.protocol, data.metadata.pointer], + ]); + const encodedData = (0, viem_1.encodeFunctionData)({ + abi: allo_config_1.abi, + functionName: "registerRecipient", + args: [this.poolId, encoded], + }); + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } - fundPool(amount) { - return this.allo.fundPool(this.poolId, amount); + getBatchRegisterRecipientData(data) { + this.checkPoolId(); + const encodedParams = []; + data.forEach((registerData) => { + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, (uint256, string)"), [ + registerData.registryAnchor, + registerData.recipientAddress, + [registerData.metadata.protocol, registerData.metadata.pointer], + ]); + encodedParams.push(encoded); + }); + const poolIds = Array(encodedParams.length).fill(this.poolId); + const encodedData = (0, viem_1.encodeFunctionData)({ + abi: allo_config_1.abi, + functionName: "batchRegisterRecipient", + args: [poolIds, encodedParams], + }); + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } - distribute(recipientIds, data) { - return this.allo.distribute(this.poolId, recipientIds, data); + distribute(data) { + this.checkPoolId(); + const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("(uint256, address, uint256, bytes32[])[]]"), [[data.map((d) => [d.index, d.recipientId, d.amount, d.merkleProof])]]); + const encodedData = (0, viem_1.encodeFunctionData)({ + abi: allo_config_1.abi, + functionName: "distribute", + args: [this.poolId, [], encoded], + }); + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } // Write functions claim(claims) { + this.checkStrategy(); const data = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "claim", args: [claims], }); @@ -245,8 +413,9 @@ class DonationVotingMerkleDistributionStrategy { }; } multicall(data) { + this.checkStrategy(); const encodedData = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "multicall", args: [data], }); @@ -257,8 +426,9 @@ class DonationVotingMerkleDistributionStrategy { }; } reviewRecipients(statuses) { + this.checkStrategy(); const data = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "reviewRecipients", args: [statuses], }); @@ -269,8 +439,9 @@ class DonationVotingMerkleDistributionStrategy { }; } updateDistribution(merkleRoot, distributionMetadata) { + this.checkStrategy(); const data = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "updateDistribution", args: [merkleRoot, distributionMetadata], }); @@ -281,8 +452,9 @@ class DonationVotingMerkleDistributionStrategy { }; } updatePoolTimestamps(registrationStartTime, registrationEndTime, allocationStartTime, allocationEndTime) { + this.checkStrategy(); const data = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "updatePoolTimestamps", args: [ registrationStartTime, @@ -298,8 +470,9 @@ class DonationVotingMerkleDistributionStrategy { }; } withdraw(amount) { + this.checkStrategy(); const data = (0, viem_1.encodeFunctionData)({ - abi: donationVoting_config_1.abi, + abi: donationVotingVault_config_1.abi, functionName: "withdraw", args: [amount], }); diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.d.ts b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.d.ts new file mode 100644 index 0000000..44fb89c --- /dev/null +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.d.ts @@ -0,0 +1,120 @@ +export declare const abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + anonymous?: undefined; + outputs?: undefined; +} | { + anonymous: boolean; + inputs: ({ + indexed: boolean; + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + indexed: boolean; + internalType: string; + name: string; + type: string; + })[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + components: ({ + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + })[]; + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + inputs: ({ + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + } | { + internalType: string; + name: string; + type: string; + components?: undefined; + })[]; + name: string; + outputs: never[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + stateMutability: string; + type: string; + inputs?: undefined; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; +})[]; +export declare const bytecode = "0x60e060405260016008553480156200001657600080fd5b5060405162003b1c38038062003b1c833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c05161388b62000291600039600081816104d40152611cac0152600061038701526000818161029b01528181610e2c01528181610f95015281816117800152611db5015261388b6000f3fe60806040526004361061021e5760003560e01c80636afdd85011610123578063df868ed3116100ab578063edd146cc1161006f578063edd146cc146106ca578063ef2920fc146106ea578063f31db3d1146106fd578063f5b0dfb71461071d578063f6f258911461073d57600080fd5b8063df868ed31461061b578063dff7d2c714610630578063e744092e14610657578063e7efcfc214610687578063eb11af931461069d57600080fd5b8063a0cf0aea116100f2578063a0cf0aea14610553578063ac9650d81461057b578063b2b878d0146105a8578063cb0e85a6146105d5578063d2e17f59146105f457600080fd5b80636afdd850146104c257806373af3453146104f657806395355b3b146105165780639af5c09d1461052c57600080fd5b806342fda9c7116101a657806351cff8d91161017557806351cff8d914610418578063570897391461043857806359a3977b146104525780635f1b55f31461047557806362812a391461049557600080fd5b806342fda9c7146103785780634533d678146103ab5780634ab4ba42146103e35780634d31d087146103f857600080fd5b806321755088116101ed57806321755088146102f35780632bbe0cae146103235780632d52eff2146103365780632eb4a7ab1461034d57806338fff2d01461036357600080fd5b806301fc1c641461022a5780630a6f0ee91461026a57806315cc481e1461028c5780632143e92f146102d357600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061025761024536600461252f565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561027657600080fd5b5061028a610285366004612760565b61076a565b005b34801561029857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610261565b3480156102df57600080fd5b5061028a6102ee3660046127ec565b61078a565b3480156102ff57600080fd5b506005546103139062010000900460ff1681565b6040519015158152602001610261565b6102bb610331366004612848565b610887565b34801561034257600080fd5b50600a541515610313565b34801561035957600080fd5b50610257600a5481565b34801561036f57600080fd5b50600154610257565b34801561038457600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610257565b3480156103b757600080fd5b506006546103cb906001600160401b031681565b6040516001600160401b039091168152602001610261565b3480156103ef57600080fd5b50600254610257565b34801561040457600080fd5b5061031361041336600461252f565b6108ac565b34801561042457600080fd5b5061028a61043336600461252f565b6108b5565b34801561044457600080fd5b506005546103139060ff1681565b34801561045e57600080fd5b5061046761092f565b6040516102619291906128e9565b34801561048157600080fd5b50610313610490366004612902565b6109c6565b3480156104a157600080fd5b506104b56104b036600461252f565b6109d1565b604051610261919061291b565b3480156104ce57600080fd5b506102bb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561050257600080fd5b5061028a61051136600461296a565b6109e2565b34801561052257600080fd5b5061025760085481565b34801561053857600080fd5b506005546103cb90630100000090046001600160401b031681565b34801561055f57600080fd5b506102bb73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561058757600080fd5b5061059b610596366004612a03565b610a84565b6040516102619190612a77565b3480156105b457600080fd5b506105c86105c3366004612ad9565b610b78565b6040516102619190612bad565b3480156105e157600080fd5b5060055461031390610100900460ff1681565b34801561060057600080fd5b506005546103cb90600160981b90046001600160401b031681565b34801561062757600080fd5b50610313610c76565b34801561063c57600080fd5b506005546103cb90600160581b90046001600160401b031681565b34801561066357600080fd5b5061031361067236600461252f565b600e6020526000908152604090205460ff1681565b34801561069357600080fd5b5061025760075481565b3480156106a957600080fd5b506106bd6106b836600461252f565b610c85565b6040516102619190612c23565b3480156106d657600080fd5b5061028a6106e5366004612c4b565b610c90565b61028a6106f8366004612848565b610ceb565b34801561070957600080fd5b5061028a610718366004612c91565b610d13565b34801561072957600080fd5b5061028a610738366004612902565b610df7565b34801561074957600080fd5b50610257610758366004612902565b600b6020526000908152604090205481565b610772610e21565b61077a610e6c565b610785838383610e8f565b505050565b3361079481610f6b565b6107a08585858561101d565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610891610e21565b610899610e6c565b6108a383836110b7565b90505b92915050565b600060016108a6565b336108bf81610f6b565b6006546108d8906001600160401b031662278d00612d61565b6001600160401b0316421161090057604051637fcce2a960e01b815260040160405180910390fd5b600061090c8330611409565b905060008061091b8284612d81565b9050610928853383611452565b5050505050565b600380546004805491929161094390612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461096f90612d94565b80156109bc5780601f10610991576101008083540402835291602001916109bc565b820191906000526020600020905b81548152906001019060200180831161099f57829003601f168201915b5050505050905082565b60006108a68261148c565b6109d96124d4565b6108a6826114cd565b6109ea6115c6565b336109f481610f6b565b60055462010000900460ff1615610a1e57604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610a3f9082612e14565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610a77929190612ed3565b60405180910390a1505050565b6060816001600160401b03811115610a9e57610a9e612553565b604051908082528060200260200182016040528015610ad157816020015b6060815260200190600190039081610abc5790505b50905060005b82811015610b7157610b4130858584818110610af557610af5612f78565b9050602002810190610b079190612f8e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115f192505050565b828281518110610b5357610b53612f78565b60200260200101819052508080610b6990612fdb565b915050610ad7565b5092915050565b81518151606091908114610b9f57604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610bb957610bb9612553565b604051908082528060200260200182016040528015610bfe57816020015b6040805180820190915260008082526020820152815260200190600190039081610bd75790505b50905060005b82811015610c6d57610c48868281518110610c2157610c21612f78565b6020026020010151868381518110610c3b57610c3b612f78565b6020026020010151611616565b828281518110610c5a57610c5a612f78565b6020908102919091010152600101610c04565b50949350505050565b6000610c806116d1565b905090565b60006108a68261171a565b610c98610e21565b600081806020019051810190610cae9190613083565b9050610cba8382611739565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610a779291906128e9565b610cf3610e21565b610cfb610e6c565b610d0582826119e7565b610d0f8282611bc6565b5050565b610d1b611d21565b33610d2581610f6b565b6008548214610d4757604051637fcce2a960e01b815260040160405180910390fd5b60005b8351811015610df1576000848281518110610d6757610d67612f78565b60200260200101516000015190506000858381518110610d8957610d89612f78565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101610d4a565b50505050565b610dff610e21565b8060026000828254610e119190613155565b90915550610e1e90508181565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e6a5760405163075fd2b160e01b815260040160405180910390fd5b565b600154600003610e6a57604051630f68fe6360e21b815260040160405180910390fd5b80610e9981610f6b565b600a54600003610ebc57604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16610ede576005805462ff00001916620100001790555b600083806020019051810190610ef4919061322a565b805190915060005b81811015610f2e57610f26838281518110610f1957610f19612f78565b6020026020010151611d4c565b600101610efc565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100091906132da565b610e1e5760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b03164211806110455750826001600160401b0316846001600160401b0316115b806110615750816001600160401b0316846001600160401b0316115b8061107d5750806001600160401b0316826001600160401b0316115b806110995750806001600160401b0316836001600160401b0316115b15610df157604051637fcce2a960e01b815260040160405180910390fd5b60006110c1611eda565b60008060006110e3604051806040016040528060008152602001606081525090565b60055460ff16156111355786806020019051810190611102919061338b565b919650935090506111138587611f2a565b6111305760405163075fd2b160e01b815260040160405180910390fd5b6111a0565b86806020019051810190611149919061338b565b6001600160a01b0383161515965090945090925090508361116a578561116c565b815b945083801561118257506111808587611f2a565b155b156111a05760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156111c3575060208101515115806111c357508051155b156111e15760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b0383166112185760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff001990931692909217825582516001830190815590830151839190600284019061127c9082612e14565b505060055460ff1690506112905784611293565b60015b815460ff19169015151781556001600160a01b0386166000908152600c6020526040812054900361136f576008546001600160a01b0387166000908152600c60205260409020556112e98660015b60ff16612022565b6000886008546040516020016113009291906133ee565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a60405161134c929190613410565b60405180910390a26008805490600061136483612fdb565b9190505550506113fe565b600061137a87612055565b905060011960ff821601611398576113938760016112e1565b6113af565b60021960ff8216016113af576113af8760046112e1565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a6113e58b612055565b6040516113f49392919061343b565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161144157506001600160a01b038116316108a6565b61144b8383612096565b90506108a6565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016114815761078582826120cb565b6107858383836120e7565b60008061149b61010084613486565b905060006114ab6101008561349a565b6000928352600d602052604090922054600190921b9182169091149392505050565b6114d56124d4565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161153a90612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461156690612d94565b80156115b35780601f10611588576101008083540402835291602001916115b3565b820191906000526020600020905b81548152906001019060200180831161159657829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b03164211610e6a57604051634543ced160e11b815260040160405180910390fd5b60606108a3838360405180606001604052806027815260200161382f60279139612136565b604080518082019091526000808252602082015260008280602001905181019061164091906134ae565b805160208201516040830151606084015193945091929091906000611664846114cd565b60200151905061167785858386866121ae565b156116a7576040518060400160405280826001600160a01b031681526020018481525096505050505050506108a6565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b6005546000904263010000009091046001600160401b0316118015906117095750600554600160581b90046001600160401b03164211155b156117145750600190565b50600090565b600061172582612055565b60ff1660068111156108a6576108a6612c0d565b61174282612257565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa1580156117cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f391906134e2565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff191691871691821790556118cd95918504821694928304821693909204169061101d565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c08101515160008190036119865760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015610df1576001600e60008560c0015184815181106119ad576119ad612f78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611989565b6119ef6122a6565b60008083806020019051810190611a0691906134ff565b80515160208101519051929450909250906002611a2285612055565b60ff166006811115611a3657611a36612c0d565b6006811115611a4757611a47612c0d565b14611a705760405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6001600160a01b0381166000908152600e602052604090205460ff16158015611ac4575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611ae257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611b0f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611b4157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611b415750813414155b15611b5f57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611bb6939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611bdd91906134ff565b80515180516020909101519294509092509073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601611c655780341015611c35576040516374c5672b60e01b815260040160405180910390fd5b6001600160a01b038085166000908152600f6020526040902054611c609161010090910416826120cb565b611d19565b82516040805180820182526001600160a01b038781166000908152600f60209081529084902054610100900482168352808301869052870151925163187945bd60e11b81527f0000000000000000000000000000000000000000000000000000000000000000909116936330f28b7a93611ce69391928b91906004016135ec565b600060405180830381600087803b158015611d0057600080fd5b505af1158015611d14573d6000803e3d6000fd5b505050505b505050505050565b6006546001600160401b0316421115610e6a5760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f909652929094205492939092909161010090910416611d9385858386866121ae565b15611eb65760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d91611dec9160040190815260200190565b600060405180830381865afa158015611e09573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e31919081019061366f565b9050611e3c866122ee565b8360026000828254611e4e9190612d81565b90915550506040810151611e63908386611452565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a350611d19565b60405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6005544263010000009091046001600160401b03161180611f0c5750600554600160581b90046001600160401b031642115b15610e6a57604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa158015611f78573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fa09190810190613722565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa158015611ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201a91906132da565b949350505050565b60008060006120308561232c565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361207c57506000919050565b6000806120888461232c565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610d0f5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d15600160005114171661212c576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b03168560405161215391906137e8565b600060405180830381855af49150503d806000811461218e576040519150601f19603f3d011682016040523d82523d6000602084013e612193565b606091505b50915091506121a48683838761239f565b9695505050505050565b60006121b98661148c565b156121c65750600061224e565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061223a83600a5483612418565b61224857600091505061224e565b60019150505b95945050505050565b61225f610e21565b600154156122805760405163439a74c960e01b815260040160405180910390fd5b806000036122a157604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806122d157506006546001600160401b031642115b15610e6a5760405162b828c960e81b815260040160405180910390fd5b60006122fc61010083613486565b9050600061230c6101008461349a565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061235790600190612d81565b90506000612366604083613486565b9050600061237560408461349a565b612380906004613804565b6000838152600b60205260409020549298909750919550909350505050565b6060831561240e578251600003612407576001600160a01b0385163b6124075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161120f565b508161201a565b61201a838361242e565b6000826124258584612458565b14949350505050565b81511561243e5781518083602001fd5b8060405162461bcd60e51b815260040161120f919061381b565b600081815b845181101561249d576124898286838151811061247c5761247c612f78565b60200260200101516124a5565b91508061249581612fdb565b91505061245d565b509392505050565b60008183106124c15760008281526020849052604090206108a3565b60008381526020839052604090206108a3565b604051806060016040528060001515815260200160006001600160a01b03168152602001612515604051806040016040528060008152602001606081525090565b905290565b6001600160a01b0381168114610e1e57600080fd5b60006020828403121561254157600080fd5b813561254c8161251a565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561258b5761258b612553565b60405290565b60405160e081016001600160401b038111828210171561258b5761258b612553565b604051608081016001600160401b038111828210171561258b5761258b612553565b604051606081016001600160401b038111828210171561258b5761258b612553565b60405160c081016001600160401b038111828210171561258b5761258b612553565b604051601f8201601f191681016001600160401b038111828210171561264157612641612553565b604052919050565b60006001600160401b0382111561266257612662612553565b5060051b60200190565b600082601f83011261267d57600080fd5b8135602061269261268d83612649565b612619565b82815260059290921b840181019181810190868411156126b157600080fd5b8286015b848110156126d55780356126c88161251a565b83529183019183016126b5565b509695505050505050565b60006001600160401b038211156126f9576126f9612553565b50601f01601f191660200190565b600061271561268d846126e0565b905082815283838301111561272957600080fd5b828260208301376000602084830101529392505050565b600082601f83011261275157600080fd5b6108a383833560208501612707565b60008060006060848603121561277557600080fd5b83356001600160401b038082111561278c57600080fd5b6127988783880161266c565b945060208601359150808211156127ae57600080fd5b506127bb86828701612740565b92505060408401356127cc8161251a565b809150509250925092565b6001600160401b0381168114610e1e57600080fd5b6000806000806080858703121561280257600080fd5b843561280d816127d7565b9350602085013561281d816127d7565b9250604085013561282d816127d7565b9150606085013561283d816127d7565b939692955090935050565b6000806040838503121561285b57600080fd5b82356001600160401b0381111561287157600080fd5b61287d85828601612740565b925050602083013561288e8161251a565b809150509250929050565b60005b838110156128b457818101518382015260200161289c565b50506000910152565b600081518084526128d5816020860160208601612899565b601f01601f19169290920160200192915050565b82815260406020820152600061201a60408301846128bd565b60006020828403121561291457600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a084015261201a60c08401826128bd565b6000806040838503121561297d57600080fd5b8235915060208301356001600160401b038082111561299b57600080fd5b90840190604082870312156129af57600080fd5b6129b7612569565b823581526020830135828111156129cd57600080fd5b80840193505086601f8401126129e257600080fd5b6129f187843560208601612707565b60208201528093505050509250929050565b60008060208385031215612a1657600080fd5b82356001600160401b0380821115612a2d57600080fd5b818501915085601f830112612a4157600080fd5b813581811115612a5057600080fd5b8660208260051b8501011115612a6557600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612acc57603f19888603018452612aba8583516128bd565b94509285019290850190600101612a9e565b5092979650505050505050565b60008060408385031215612aec57600080fd5b82356001600160401b0380821115612b0357600080fd5b612b0f8683870161266c565b9350602091508185013581811115612b2657600080fd5b8501601f81018713612b3757600080fd5b8035612b4561268d82612649565b81815260059190911b82018401908481019089831115612b6457600080fd5b8584015b83811015612b9c57803586811115612b805760008081fd5b612b8e8c8983890101612740565b845250918601918601612b68565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612c0057612bf084835180516001600160a01b03168252602090810151910152565b9284019290850190600101612bca565b5091979650505050505050565b634e487b7160e01b600052602160045260246000fd5b6020810160078310612c4557634e487b7160e01b600052602160045260246000fd5b91905290565b60008060408385031215612c5e57600080fd5b8235915060208301356001600160401b03811115612c7b57600080fd5b612c8785828601612740565b9150509250929050565b6000806040808486031215612ca557600080fd5b83356001600160401b03811115612cbb57600080fd5b8401601f81018613612ccc57600080fd5b80356020612cdc61268d83612649565b82815260069290921b83018101918181019089841115612cfb57600080fd5b938201935b83851015612d3b5785858b031215612d185760008081fd5b612d20612569565b85358152838601358482015282529385019390820190612d00565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610b7157610b71612d4b565b818103818111156108a6576108a6612d4b565b600181811c90821680612da857607f821691505b602082108103612dc857634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561078557600081815260208120601f850160051c81016020861015612df55750805b601f850160051c820191505b81811015611d1957828155600101612e01565b81516001600160401b03811115612e2d57612e2d612553565b612e4181612e3b8454612d94565b84612dce565b602080601f831160018114612e765760008415612e5e5750858301515b600019600386901b1c1916600185901b178555611d19565b600085815260208120601f198616915b82811015612ea557888601518255948401946001909101908401612e86565b5085821015612ec35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b828152600060206040818401528354604084015260018085016040606086015260008154612f0081612d94565b80608089015260a085831660008114612f205760018114612f3a57612f68565b60ff1984168a83015282151560051b8a0182019450612f68565b856000528760002060005b84811015612f605781548c8201850152908801908901612f45565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612fa557600080fd5b8301803591506001600160401b03821115612fbf57600080fd5b602001915036819003821315612fd457600080fd5b9250929050565b600060018201612fed57612fed612d4b565b5060010190565b8051801515811461300457600080fd5b919050565b8051613004816127d7565b80516130048161251a565b600082601f83011261303057600080fd5b8151602061304061268d83612649565b82815260059290921b8401810191818101908684111561305f57600080fd5b8286015b848110156126d55780516130768161251a565b8352918301918301613063565b60006020828403121561309557600080fd5b81516001600160401b03808211156130ac57600080fd5b9083019060e082860312156130c057600080fd5b6130c8612591565b6130d183612ff4565b81526130df60208401612ff4565b60208201526130f060408401613009565b604082015261310160608401613009565b606082015261311260808401613009565b608082015261312360a08401613009565b60a082015260c08301518281111561313a57600080fd5b6131468782860161301f565b60c08301525095945050505050565b808201808211156108a6576108a6612d4b565b60006080828403121561317a57600080fd5b6131826125b3565b9050815181526020808301516131978161251a565b828201526040838101519083015260608301516001600160401b038111156131be57600080fd5b8301601f810185136131cf57600080fd5b80516131dd61268d82612649565b81815260059190911b820183019083810190878311156131fc57600080fd5b928401925b8284101561321a57835182529284019290840190613201565b6060860152509295945050505050565b6000602080838503121561323d57600080fd5b82516001600160401b038082111561325457600080fd5b818501915085601f83011261326857600080fd5b815161327661268d82612649565b81815260059190911b8301840190848101908883111561329557600080fd5b8585015b838110156132cd578051858111156132b15760008081fd5b6132bf8b89838a0101613168565b845250918601918601613299565b5098975050505050505050565b6000602082840312156132ec57600080fd5b6108a382612ff4565b600082601f83011261330657600080fd5b815161331461268d826126e0565b81815284602083860101111561332957600080fd5b61201a826020830160208701612899565b60006040828403121561334c57600080fd5b613354612569565b90508151815260208201516001600160401b0381111561337357600080fd5b61337f848285016132f5565b60208301525092915050565b6000806000606084860312156133a057600080fd5b83516133ab8161251a565b60208501519093506133bc8161251a565b60408501519092506001600160401b038111156133d857600080fd5b6133e48682870161333a565b9150509250925092565b60408152600061340160408301856128bd565b90508260208301529392505050565b60408152600061342360408301856128bd565b90506001600160a01b03831660208301529392505050565b60608152600061344e60608301866128bd565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261349557613495613470565b500490565b6000826134a9576134a9613470565b500690565b6000602082840312156134c057600080fd5b81516001600160401b038111156134d657600080fd5b61201a84828501613168565b6000602082840312156134f457600080fd5b815161254c8161251a565b6000806040838503121561351257600080fd5b825161351d8161251a565b60208401519092506001600160401b038082111561353a57600080fd5b9084019081860360a081121561354f57600080fd5b613557612569565b608082121561356557600080fd5b61356d6125d5565b604083121561357b57600080fd5b613583612569565b925084516135908161251a565b808452506020850151602084015282815260408501516020820152606085015160408201528082525060808401519150828211156135cd57600080fd5b6135d9888386016132f5565b6020820152809450505050509250929050565b600061010061360f83885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613643608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613664818401856128bd565b979650505050505050565b60006020828403121561368157600080fd5b81516001600160401b038082111561369857600080fd5b9083019060c082860312156136ac57600080fd5b6136b46125f7565b8251815260208301516136c68161251a565b602082015260408301516136d98161251a565b60408201526060830151828111156136f057600080fd5b6136fc8782860161333a565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b60006020828403121561373457600080fd5b81516001600160401b038082111561374b57600080fd5b9083019060c0828603121561375f57600080fd5b6137676125f7565b825181526020830151602082015260408301518281111561378757600080fd5b613793878286016132f5565b6040830152506060830151828111156137ab57600080fd5b6137b78782860161333a565b6060830152506137c960808401613014565b60808201526137da60a08401613014565b60a082015295945050505050565b600082516137fa818460208701612899565b9190910192915050565b80820281158282048414176108a6576108a6612d4b565b6020815260006108a360208301846128bd56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066ba78cb9e66b6229d608a9ab5fdd94cb622d29339db457bfddc28c0eccdc13064736f6c63430008130033"; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.js b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.js new file mode 100644 index 0000000..9bbe6e1 --- /dev/null +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.js @@ -0,0 +1,1136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bytecode = exports.abi = void 0; +// uses Vault abi, since it's the same like direct transfer + an additional claim function +exports.abi = [ + { + inputs: [ + { + internalType: "address", + name: "_allo", + type: "address", + }, + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "contract ISignatureTransfer", + name: "_permit2", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ALLOCATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ENDED", + type: "error", + }, + { + inputs: [], + name: "ALREADY_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "AMOUNT_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "ANCHOR_ERROR", + type: "error", + }, + { + inputs: [], + name: "ARRAY_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "INVALID", + type: "error", + }, + { + inputs: [], + name: "INVALID_ADDRESS", + type: "error", + }, + { + inputs: [], + name: "INVALID_FEE", + type: "error", + }, + { + inputs: [], + name: "INVALID_METADATA", + type: "error", + }, + { + inputs: [], + name: "INVALID_REGISTRATION", + type: "error", + }, + { + inputs: [], + name: "IS_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "MISMATCH", + type: "error", + }, + { + inputs: [], + name: "NONCE_NOT_AVAILABLE", + type: "error", + }, + { + inputs: [], + name: "NOT_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "NOT_ENOUGH_FUNDS", + type: "error", + }, + { + inputs: [], + name: "NOT_IMPLEMENTED", + type: "error", + }, + { + inputs: [], + name: "NOT_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "NOT_PENDING_OWNER", + type: "error", + }, + { + inputs: [], + name: "POOL_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "POOL_INACTIVE", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_ALREADY_ACCEPTED", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "RECIPIENT_ERROR", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_NOT_ACCEPTED", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "UNAUTHORIZED", + type: "error", + }, + { + inputs: [], + name: "ZERO_ADDRESS", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Allocated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "BatchPayoutSuccessful", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Distributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + name: "DistributionUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "grantee", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "FundsDistributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "poolId", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool", + }, + ], + name: "PoolActive", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "rowIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fullRow", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RecipientStatusUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Registered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "registrationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "registrationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "TimestampsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint8", + name: "status", + type: "uint8", + }, + ], + name: "UpdatedRegistration", + type: "event", + }, + { + inputs: [], + name: "NATIVE", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT2", + outputs: [ + { + internalType: "contract ISignatureTransfer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "allocate", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "allocationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allocationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "distribute", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributionMetadata", + outputs: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "distributionStarted", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAllo", + outputs: [ + { + internalType: "contract IAllo", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "_data", + type: "bytes[]", + }, + ], + name: "getPayouts", + outputs: [ + { + components: [ + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + internalType: "struct IStrategy.PayoutSummary[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipient", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "useRegistryAnchor", + type: "bool", + }, + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + internalType: "struct DonationVotingMerkleDistributionBaseStrategy.Recipient", + name: "recipient", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipientStatus", + outputs: [ + { + internalType: "enum IStrategy.Status", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getStrategyId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_index", + type: "uint256", + }, + ], + name: "hasBeenDistributed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "increasePoolAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_poolId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isDistributionSet", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isPoolActive", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_allocator", + type: "address", + }, + ], + name: "isValidAllocator", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "merkleRoot", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "metadataRequired", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "recipientToStatusIndexes", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "recipientsCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "registerRecipient", + outputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "registrationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "registrationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "statusRow", + type: "uint256", + }, + ], + internalType: "struct DonationVotingMerkleDistributionBaseStrategy.ApplicationStatus[]", + name: "statuses", + type: "tuple[]", + }, + { + internalType: "uint256", + name: "refRecipientsCounter", + type: "uint256", + }, + ], + name: "reviewRecipients", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "statusesBitMap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalPayoutAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "_distributionMetadata", + type: "tuple", + }, + ], + name: "updateDistribution", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "_registrationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_registrationEndTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationEndTime", + type: "uint64", + }, + ], + name: "updatePoolTimestamps", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useRegistryAnchor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +]; +exports.bytecode = "0x60e060405260016008553480156200001657600080fd5b5060405162003b1c38038062003b1c833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c05161388b62000291600039600081816104d40152611cac0152600061038701526000818161029b01528181610e2c01528181610f95015281816117800152611db5015261388b6000f3fe60806040526004361061021e5760003560e01c80636afdd85011610123578063df868ed3116100ab578063edd146cc1161006f578063edd146cc146106ca578063ef2920fc146106ea578063f31db3d1146106fd578063f5b0dfb71461071d578063f6f258911461073d57600080fd5b8063df868ed31461061b578063dff7d2c714610630578063e744092e14610657578063e7efcfc214610687578063eb11af931461069d57600080fd5b8063a0cf0aea116100f2578063a0cf0aea14610553578063ac9650d81461057b578063b2b878d0146105a8578063cb0e85a6146105d5578063d2e17f59146105f457600080fd5b80636afdd850146104c257806373af3453146104f657806395355b3b146105165780639af5c09d1461052c57600080fd5b806342fda9c7116101a657806351cff8d91161017557806351cff8d914610418578063570897391461043857806359a3977b146104525780635f1b55f31461047557806362812a391461049557600080fd5b806342fda9c7146103785780634533d678146103ab5780634ab4ba42146103e35780634d31d087146103f857600080fd5b806321755088116101ed57806321755088146102f35780632bbe0cae146103235780632d52eff2146103365780632eb4a7ab1461034d57806338fff2d01461036357600080fd5b806301fc1c641461022a5780630a6f0ee91461026a57806315cc481e1461028c5780632143e92f146102d357600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061025761024536600461252f565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561027657600080fd5b5061028a610285366004612760565b61076a565b005b34801561029857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610261565b3480156102df57600080fd5b5061028a6102ee3660046127ec565b61078a565b3480156102ff57600080fd5b506005546103139062010000900460ff1681565b6040519015158152602001610261565b6102bb610331366004612848565b610887565b34801561034257600080fd5b50600a541515610313565b34801561035957600080fd5b50610257600a5481565b34801561036f57600080fd5b50600154610257565b34801561038457600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610257565b3480156103b757600080fd5b506006546103cb906001600160401b031681565b6040516001600160401b039091168152602001610261565b3480156103ef57600080fd5b50600254610257565b34801561040457600080fd5b5061031361041336600461252f565b6108ac565b34801561042457600080fd5b5061028a61043336600461252f565b6108b5565b34801561044457600080fd5b506005546103139060ff1681565b34801561045e57600080fd5b5061046761092f565b6040516102619291906128e9565b34801561048157600080fd5b50610313610490366004612902565b6109c6565b3480156104a157600080fd5b506104b56104b036600461252f565b6109d1565b604051610261919061291b565b3480156104ce57600080fd5b506102bb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561050257600080fd5b5061028a61051136600461296a565b6109e2565b34801561052257600080fd5b5061025760085481565b34801561053857600080fd5b506005546103cb90630100000090046001600160401b031681565b34801561055f57600080fd5b506102bb73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561058757600080fd5b5061059b610596366004612a03565b610a84565b6040516102619190612a77565b3480156105b457600080fd5b506105c86105c3366004612ad9565b610b78565b6040516102619190612bad565b3480156105e157600080fd5b5060055461031390610100900460ff1681565b34801561060057600080fd5b506005546103cb90600160981b90046001600160401b031681565b34801561062757600080fd5b50610313610c76565b34801561063c57600080fd5b506005546103cb90600160581b90046001600160401b031681565b34801561066357600080fd5b5061031361067236600461252f565b600e6020526000908152604090205460ff1681565b34801561069357600080fd5b5061025760075481565b3480156106a957600080fd5b506106bd6106b836600461252f565b610c85565b6040516102619190612c23565b3480156106d657600080fd5b5061028a6106e5366004612c4b565b610c90565b61028a6106f8366004612848565b610ceb565b34801561070957600080fd5b5061028a610718366004612c91565b610d13565b34801561072957600080fd5b5061028a610738366004612902565b610df7565b34801561074957600080fd5b50610257610758366004612902565b600b6020526000908152604090205481565b610772610e21565b61077a610e6c565b610785838383610e8f565b505050565b3361079481610f6b565b6107a08585858561101d565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610891610e21565b610899610e6c565b6108a383836110b7565b90505b92915050565b600060016108a6565b336108bf81610f6b565b6006546108d8906001600160401b031662278d00612d61565b6001600160401b0316421161090057604051637fcce2a960e01b815260040160405180910390fd5b600061090c8330611409565b905060008061091b8284612d81565b9050610928853383611452565b5050505050565b600380546004805491929161094390612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461096f90612d94565b80156109bc5780601f10610991576101008083540402835291602001916109bc565b820191906000526020600020905b81548152906001019060200180831161099f57829003601f168201915b5050505050905082565b60006108a68261148c565b6109d96124d4565b6108a6826114cd565b6109ea6115c6565b336109f481610f6b565b60055462010000900460ff1615610a1e57604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610a3f9082612e14565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610a77929190612ed3565b60405180910390a1505050565b6060816001600160401b03811115610a9e57610a9e612553565b604051908082528060200260200182016040528015610ad157816020015b6060815260200190600190039081610abc5790505b50905060005b82811015610b7157610b4130858584818110610af557610af5612f78565b9050602002810190610b079190612f8e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115f192505050565b828281518110610b5357610b53612f78565b60200260200101819052508080610b6990612fdb565b915050610ad7565b5092915050565b81518151606091908114610b9f57604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610bb957610bb9612553565b604051908082528060200260200182016040528015610bfe57816020015b6040805180820190915260008082526020820152815260200190600190039081610bd75790505b50905060005b82811015610c6d57610c48868281518110610c2157610c21612f78565b6020026020010151868381518110610c3b57610c3b612f78565b6020026020010151611616565b828281518110610c5a57610c5a612f78565b6020908102919091010152600101610c04565b50949350505050565b6000610c806116d1565b905090565b60006108a68261171a565b610c98610e21565b600081806020019051810190610cae9190613083565b9050610cba8382611739565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610a779291906128e9565b610cf3610e21565b610cfb610e6c565b610d0582826119e7565b610d0f8282611bc6565b5050565b610d1b611d21565b33610d2581610f6b565b6008548214610d4757604051637fcce2a960e01b815260040160405180910390fd5b60005b8351811015610df1576000848281518110610d6757610d67612f78565b60200260200101516000015190506000858381518110610d8957610d89612f78565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101610d4a565b50505050565b610dff610e21565b8060026000828254610e119190613155565b90915550610e1e90508181565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e6a5760405163075fd2b160e01b815260040160405180910390fd5b565b600154600003610e6a57604051630f68fe6360e21b815260040160405180910390fd5b80610e9981610f6b565b600a54600003610ebc57604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16610ede576005805462ff00001916620100001790555b600083806020019051810190610ef4919061322a565b805190915060005b81811015610f2e57610f26838281518110610f1957610f19612f78565b6020026020010151611d4c565b600101610efc565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100091906132da565b610e1e5760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b03164211806110455750826001600160401b0316846001600160401b0316115b806110615750816001600160401b0316846001600160401b0316115b8061107d5750806001600160401b0316826001600160401b0316115b806110995750806001600160401b0316836001600160401b0316115b15610df157604051637fcce2a960e01b815260040160405180910390fd5b60006110c1611eda565b60008060006110e3604051806040016040528060008152602001606081525090565b60055460ff16156111355786806020019051810190611102919061338b565b919650935090506111138587611f2a565b6111305760405163075fd2b160e01b815260040160405180910390fd5b6111a0565b86806020019051810190611149919061338b565b6001600160a01b0383161515965090945090925090508361116a578561116c565b815b945083801561118257506111808587611f2a565b155b156111a05760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156111c3575060208101515115806111c357508051155b156111e15760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b0383166112185760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff001990931692909217825582516001830190815590830151839190600284019061127c9082612e14565b505060055460ff1690506112905784611293565b60015b815460ff19169015151781556001600160a01b0386166000908152600c6020526040812054900361136f576008546001600160a01b0387166000908152600c60205260409020556112e98660015b60ff16612022565b6000886008546040516020016113009291906133ee565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a60405161134c929190613410565b60405180910390a26008805490600061136483612fdb565b9190505550506113fe565b600061137a87612055565b905060011960ff821601611398576113938760016112e1565b6113af565b60021960ff8216016113af576113af8760046112e1565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a6113e58b612055565b6040516113f49392919061343b565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161144157506001600160a01b038116316108a6565b61144b8383612096565b90506108a6565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016114815761078582826120cb565b6107858383836120e7565b60008061149b61010084613486565b905060006114ab6101008561349a565b6000928352600d602052604090922054600190921b9182169091149392505050565b6114d56124d4565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161153a90612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461156690612d94565b80156115b35780601f10611588576101008083540402835291602001916115b3565b820191906000526020600020905b81548152906001019060200180831161159657829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b03164211610e6a57604051634543ced160e11b815260040160405180910390fd5b60606108a3838360405180606001604052806027815260200161382f60279139612136565b604080518082019091526000808252602082015260008280602001905181019061164091906134ae565b805160208201516040830151606084015193945091929091906000611664846114cd565b60200151905061167785858386866121ae565b156116a7576040518060400160405280826001600160a01b031681526020018481525096505050505050506108a6565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b6005546000904263010000009091046001600160401b0316118015906117095750600554600160581b90046001600160401b03164211155b156117145750600190565b50600090565b600061172582612055565b60ff1660068111156108a6576108a6612c0d565b61174282612257565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa1580156117cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f391906134e2565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff191691871691821790556118cd95918504821694928304821693909204169061101d565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c08101515160008190036119865760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015610df1576001600e60008560c0015184815181106119ad576119ad612f78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611989565b6119ef6122a6565b60008083806020019051810190611a0691906134ff565b80515160208101519051929450909250906002611a2285612055565b60ff166006811115611a3657611a36612c0d565b6006811115611a4757611a47612c0d565b14611a705760405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6001600160a01b0381166000908152600e602052604090205460ff16158015611ac4575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611ae257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611b0f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611b4157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611b415750813414155b15611b5f57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611bb6939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611bdd91906134ff565b80515180516020909101519294509092509073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601611c655780341015611c35576040516374c5672b60e01b815260040160405180910390fd5b6001600160a01b038085166000908152600f6020526040902054611c609161010090910416826120cb565b611d19565b82516040805180820182526001600160a01b038781166000908152600f60209081529084902054610100900482168352808301869052870151925163187945bd60e11b81527f0000000000000000000000000000000000000000000000000000000000000000909116936330f28b7a93611ce69391928b91906004016135ec565b600060405180830381600087803b158015611d0057600080fd5b505af1158015611d14573d6000803e3d6000fd5b505050505b505050505050565b6006546001600160401b0316421115610e6a5760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f909652929094205492939092909161010090910416611d9385858386866121ae565b15611eb65760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d91611dec9160040190815260200190565b600060405180830381865afa158015611e09573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e31919081019061366f565b9050611e3c866122ee565b8360026000828254611e4e9190612d81565b90915550506040810151611e63908386611452565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a350611d19565b60405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6005544263010000009091046001600160401b03161180611f0c5750600554600160581b90046001600160401b031642115b15610e6a57604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa158015611f78573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fa09190810190613722565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa158015611ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201a91906132da565b949350505050565b60008060006120308561232c565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361207c57506000919050565b6000806120888461232c565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610d0f5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d15600160005114171661212c576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b03168560405161215391906137e8565b600060405180830381855af49150503d806000811461218e576040519150601f19603f3d011682016040523d82523d6000602084013e612193565b606091505b50915091506121a48683838761239f565b9695505050505050565b60006121b98661148c565b156121c65750600061224e565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061223a83600a5483612418565b61224857600091505061224e565b60019150505b95945050505050565b61225f610e21565b600154156122805760405163439a74c960e01b815260040160405180910390fd5b806000036122a157604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806122d157506006546001600160401b031642115b15610e6a5760405162b828c960e81b815260040160405180910390fd5b60006122fc61010083613486565b9050600061230c6101008461349a565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061235790600190612d81565b90506000612366604083613486565b9050600061237560408461349a565b612380906004613804565b6000838152600b60205260409020549298909750919550909350505050565b6060831561240e578251600003612407576001600160a01b0385163b6124075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161120f565b508161201a565b61201a838361242e565b6000826124258584612458565b14949350505050565b81511561243e5781518083602001fd5b8060405162461bcd60e51b815260040161120f919061381b565b600081815b845181101561249d576124898286838151811061247c5761247c612f78565b60200260200101516124a5565b91508061249581612fdb565b91505061245d565b509392505050565b60008183106124c15760008281526020849052604090206108a3565b60008381526020839052604090206108a3565b604051806060016040528060001515815260200160006001600160a01b03168152602001612515604051806040016040528060008152602001606081525090565b905290565b6001600160a01b0381168114610e1e57600080fd5b60006020828403121561254157600080fd5b813561254c8161251a565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561258b5761258b612553565b60405290565b60405160e081016001600160401b038111828210171561258b5761258b612553565b604051608081016001600160401b038111828210171561258b5761258b612553565b604051606081016001600160401b038111828210171561258b5761258b612553565b60405160c081016001600160401b038111828210171561258b5761258b612553565b604051601f8201601f191681016001600160401b038111828210171561264157612641612553565b604052919050565b60006001600160401b0382111561266257612662612553565b5060051b60200190565b600082601f83011261267d57600080fd5b8135602061269261268d83612649565b612619565b82815260059290921b840181019181810190868411156126b157600080fd5b8286015b848110156126d55780356126c88161251a565b83529183019183016126b5565b509695505050505050565b60006001600160401b038211156126f9576126f9612553565b50601f01601f191660200190565b600061271561268d846126e0565b905082815283838301111561272957600080fd5b828260208301376000602084830101529392505050565b600082601f83011261275157600080fd5b6108a383833560208501612707565b60008060006060848603121561277557600080fd5b83356001600160401b038082111561278c57600080fd5b6127988783880161266c565b945060208601359150808211156127ae57600080fd5b506127bb86828701612740565b92505060408401356127cc8161251a565b809150509250925092565b6001600160401b0381168114610e1e57600080fd5b6000806000806080858703121561280257600080fd5b843561280d816127d7565b9350602085013561281d816127d7565b9250604085013561282d816127d7565b9150606085013561283d816127d7565b939692955090935050565b6000806040838503121561285b57600080fd5b82356001600160401b0381111561287157600080fd5b61287d85828601612740565b925050602083013561288e8161251a565b809150509250929050565b60005b838110156128b457818101518382015260200161289c565b50506000910152565b600081518084526128d5816020860160208601612899565b601f01601f19169290920160200192915050565b82815260406020820152600061201a60408301846128bd565b60006020828403121561291457600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a084015261201a60c08401826128bd565b6000806040838503121561297d57600080fd5b8235915060208301356001600160401b038082111561299b57600080fd5b90840190604082870312156129af57600080fd5b6129b7612569565b823581526020830135828111156129cd57600080fd5b80840193505086601f8401126129e257600080fd5b6129f187843560208601612707565b60208201528093505050509250929050565b60008060208385031215612a1657600080fd5b82356001600160401b0380821115612a2d57600080fd5b818501915085601f830112612a4157600080fd5b813581811115612a5057600080fd5b8660208260051b8501011115612a6557600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612acc57603f19888603018452612aba8583516128bd565b94509285019290850190600101612a9e565b5092979650505050505050565b60008060408385031215612aec57600080fd5b82356001600160401b0380821115612b0357600080fd5b612b0f8683870161266c565b9350602091508185013581811115612b2657600080fd5b8501601f81018713612b3757600080fd5b8035612b4561268d82612649565b81815260059190911b82018401908481019089831115612b6457600080fd5b8584015b83811015612b9c57803586811115612b805760008081fd5b612b8e8c8983890101612740565b845250918601918601612b68565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612c0057612bf084835180516001600160a01b03168252602090810151910152565b9284019290850190600101612bca565b5091979650505050505050565b634e487b7160e01b600052602160045260246000fd5b6020810160078310612c4557634e487b7160e01b600052602160045260246000fd5b91905290565b60008060408385031215612c5e57600080fd5b8235915060208301356001600160401b03811115612c7b57600080fd5b612c8785828601612740565b9150509250929050565b6000806040808486031215612ca557600080fd5b83356001600160401b03811115612cbb57600080fd5b8401601f81018613612ccc57600080fd5b80356020612cdc61268d83612649565b82815260069290921b83018101918181019089841115612cfb57600080fd5b938201935b83851015612d3b5785858b031215612d185760008081fd5b612d20612569565b85358152838601358482015282529385019390820190612d00565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610b7157610b71612d4b565b818103818111156108a6576108a6612d4b565b600181811c90821680612da857607f821691505b602082108103612dc857634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561078557600081815260208120601f850160051c81016020861015612df55750805b601f850160051c820191505b81811015611d1957828155600101612e01565b81516001600160401b03811115612e2d57612e2d612553565b612e4181612e3b8454612d94565b84612dce565b602080601f831160018114612e765760008415612e5e5750858301515b600019600386901b1c1916600185901b178555611d19565b600085815260208120601f198616915b82811015612ea557888601518255948401946001909101908401612e86565b5085821015612ec35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b828152600060206040818401528354604084015260018085016040606086015260008154612f0081612d94565b80608089015260a085831660008114612f205760018114612f3a57612f68565b60ff1984168a83015282151560051b8a0182019450612f68565b856000528760002060005b84811015612f605781548c8201850152908801908901612f45565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612fa557600080fd5b8301803591506001600160401b03821115612fbf57600080fd5b602001915036819003821315612fd457600080fd5b9250929050565b600060018201612fed57612fed612d4b565b5060010190565b8051801515811461300457600080fd5b919050565b8051613004816127d7565b80516130048161251a565b600082601f83011261303057600080fd5b8151602061304061268d83612649565b82815260059290921b8401810191818101908684111561305f57600080fd5b8286015b848110156126d55780516130768161251a565b8352918301918301613063565b60006020828403121561309557600080fd5b81516001600160401b03808211156130ac57600080fd5b9083019060e082860312156130c057600080fd5b6130c8612591565b6130d183612ff4565b81526130df60208401612ff4565b60208201526130f060408401613009565b604082015261310160608401613009565b606082015261311260808401613009565b608082015261312360a08401613009565b60a082015260c08301518281111561313a57600080fd5b6131468782860161301f565b60c08301525095945050505050565b808201808211156108a6576108a6612d4b565b60006080828403121561317a57600080fd5b6131826125b3565b9050815181526020808301516131978161251a565b828201526040838101519083015260608301516001600160401b038111156131be57600080fd5b8301601f810185136131cf57600080fd5b80516131dd61268d82612649565b81815260059190911b820183019083810190878311156131fc57600080fd5b928401925b8284101561321a57835182529284019290840190613201565b6060860152509295945050505050565b6000602080838503121561323d57600080fd5b82516001600160401b038082111561325457600080fd5b818501915085601f83011261326857600080fd5b815161327661268d82612649565b81815260059190911b8301840190848101908883111561329557600080fd5b8585015b838110156132cd578051858111156132b15760008081fd5b6132bf8b89838a0101613168565b845250918601918601613299565b5098975050505050505050565b6000602082840312156132ec57600080fd5b6108a382612ff4565b600082601f83011261330657600080fd5b815161331461268d826126e0565b81815284602083860101111561332957600080fd5b61201a826020830160208701612899565b60006040828403121561334c57600080fd5b613354612569565b90508151815260208201516001600160401b0381111561337357600080fd5b61337f848285016132f5565b60208301525092915050565b6000806000606084860312156133a057600080fd5b83516133ab8161251a565b60208501519093506133bc8161251a565b60408501519092506001600160401b038111156133d857600080fd5b6133e48682870161333a565b9150509250925092565b60408152600061340160408301856128bd565b90508260208301529392505050565b60408152600061342360408301856128bd565b90506001600160a01b03831660208301529392505050565b60608152600061344e60608301866128bd565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261349557613495613470565b500490565b6000826134a9576134a9613470565b500690565b6000602082840312156134c057600080fd5b81516001600160401b038111156134d657600080fd5b61201a84828501613168565b6000602082840312156134f457600080fd5b815161254c8161251a565b6000806040838503121561351257600080fd5b825161351d8161251a565b60208401519092506001600160401b038082111561353a57600080fd5b9084019081860360a081121561354f57600080fd5b613557612569565b608082121561356557600080fd5b61356d6125d5565b604083121561357b57600080fd5b613583612569565b925084516135908161251a565b808452506020850151602084015282815260408501516020820152606085015160408201528082525060808401519150828211156135cd57600080fd5b6135d9888386016132f5565b6020820152809450505050509250929050565b600061010061360f83885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613643608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613664818401856128bd565b979650505050505050565b60006020828403121561368157600080fd5b81516001600160401b038082111561369857600080fd5b9083019060c082860312156136ac57600080fd5b6136b46125f7565b8251815260208301516136c68161251a565b602082015260408301516136d98161251a565b60408201526060830151828111156136f057600080fd5b6136fc8782860161333a565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b60006020828403121561373457600080fd5b81516001600160401b038082111561374b57600080fd5b9083019060c0828603121561375f57600080fd5b6137676125f7565b825181526020830151602082015260408301518281111561378757600080fd5b613793878286016132f5565b6040830152506060830151828111156137ab57600080fd5b6137b78782860161333a565b6060830152506137c960808401613014565b60808201526137da60a08401613014565b60a082015295945050505050565b600082516137fa818460208701612899565b9190910192915050565b80820281158282048414176108a6576108a6612d4b565b6020815260006108a360208301846128bd56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066ba78cb9e66b6229d608a9ab5fdd94cb622d29339db457bfddc28c0eccdc13064736f6c63430008130033"; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.d.ts b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.d.ts new file mode 100644 index 0000000..75c5d10 --- /dev/null +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.d.ts @@ -0,0 +1,120 @@ +export declare const abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + anonymous?: undefined; + outputs?: undefined; +} | { + anonymous: boolean; + inputs: ({ + indexed: boolean; + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + indexed: boolean; + internalType: string; + name: string; + type: string; + })[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + components: ({ + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + })[]; + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + inputs: ({ + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + } | { + internalType: string; + name: string; + type: string; + components?: undefined; + })[]; + name: string; + outputs: never[]; + stateMutability: string; + type: string; + anonymous?: undefined; +} | { + stateMutability: string; + type: string; + inputs?: undefined; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; +})[]; +export declare const bytecode = "0x60e060405260016008553480156200001657600080fd5b5060405162003fd138038062003fd1833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c051613d40620002916000396000818161055a0152612003015260006103e00152600081816102bc01528181611153015281816112bc01528181611b0001526121910152613d406000f3fe60806040526004361061023f5760003560e01c80636afdd8501161012e578063df868ed3116100ab578063edd146cc1161006f578063edd146cc14610770578063ef2920fc14610790578063f31db3d1146107a3578063f5b0dfb7146107c3578063f6f25891146107e357600080fd5b8063df868ed3146106c1578063dff7d2c7146106d6578063e744092e146106fd578063e7efcfc21461072d578063eb11af931461074357600080fd5b8063ac9650d8116100f2578063ac9650d814610601578063b2b878d01461062e578063cb0e85a61461065b578063d26839371461067a578063d2e17f591461069a57600080fd5b80636afdd8501461054857806373af34531461057c57806395355b3b1461059c5780639af5c09d146105b2578063a0cf0aea146105d957600080fd5b806342fda9c7116101bc5780635708973911610180578063570897391461049157806359a3977b146104ab5780635f1b55f3146104ce57806362812a39146104ee5780636923e09a1461051b57600080fd5b806342fda9c7146103d15780634533d678146104045780634ab4ba421461043c5780634d31d0871461045157806351cff8d91461047157600080fd5b80632bbe0cae116102035780632bbe0cae146103445780632d52eff2146103575780632eb4a7ab1461036e57806338fff2d0146103845780633f733c6b1461039957600080fd5b806301fc1c641461024b5780630a6f0ee91461028b57806315cc481e146102ad5780632143e92f146102f4578063217550881461031457600080fd5b3661024657005b600080fd5b34801561025757600080fd5b50610278610266366004612913565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561029757600080fd5b506102ab6102a6366004612b44565b610810565b005b3480156102b957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610282565b34801561030057600080fd5b506102ab61030f366004612bd0565b610830565b34801561032057600080fd5b506005546103349062010000900460ff1681565b6040519015158152602001610282565b6102dc610352366004612c2c565b61092d565b34801561036357600080fd5b50600a541515610334565b34801561037a57600080fd5b50610278600a5481565b34801561039057600080fd5b50600154610278565b3480156103a557600080fd5b506102786103b4366004612c7d565b604360209081526000928352604080842090915290825290205481565b3480156103dd57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610278565b34801561041057600080fd5b50600654610424906001600160401b031681565b6040516001600160401b039091168152602001610282565b34801561044857600080fd5b50600254610278565b34801561045d57600080fd5b5061033461046c366004612913565b610952565b34801561047d57600080fd5b506102ab61048c366004612913565b61095b565b34801561049d57600080fd5b506005546103349060ff1681565b3480156104b757600080fd5b506104c06109f7565b604051610282929190612cfb565b3480156104da57600080fd5b506103346104e9366004612d14565b610a8e565b3480156104fa57600080fd5b5061050e610509366004612913565b610a99565b6040516102829190612d2d565b34801561052757600080fd5b50610278610536366004612913565b60446020526000908152604090205481565b34801561055457600080fd5b506102dc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058857600080fd5b506102ab610597366004612d7c565b610aaa565b3480156105a857600080fd5b5061027860085481565b3480156105be57600080fd5b5060055461042490630100000090046001600160401b031681565b3480156105e557600080fd5b506102dc73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561060d57600080fd5b5061062161061c366004612e15565b610b4c565b6040516102829190612e89565b34801561063a57600080fd5b5061064e610649366004612eeb565b610c40565b6040516102829190612fbf565b34801561066757600080fd5b5060055461033490610100900460ff1681565b34801561068657600080fd5b506102ab61069536600461301f565b610d3e565b3480156106a657600080fd5b5060055461042490600160981b90046001600160401b031681565b3480156106cd57600080fd5b50610334610fa1565b3480156106e257600080fd5b5060055461042490600160581b90046001600160401b031681565b34801561070957600080fd5b50610334610718366004612913565b600e6020526000908152604090205460ff1681565b34801561073957600080fd5b5061027860075481565b34801561074f57600080fd5b5061076361075e366004612913565b610fb0565b6040516102829190613097565b34801561077c57600080fd5b506102ab61078b3660046130bf565b610fbb565b6102ab61079e366004612c2c565b611016565b3480156107af57600080fd5b506102ab6107be366004613105565b61103a565b3480156107cf57600080fd5b506102ab6107de366004612d14565b61111e565b3480156107ef57600080fd5b506102786107fe366004612d14565b600b6020526000908152604090205481565b610818611148565b610820611193565b61082b8383836111b6565b505050565b3361083a81611292565b61084685858585611344565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610937611148565b61093f611193565b61094983836113de565b90505b92915050565b6000600161094c565b3361096581611292565b60065461097e906001600160401b031662278d006131d5565b6001600160401b031642116109a657604051637fcce2a960e01b815260040160405180910390fd5b60006109b28330611730565b905060006109d5846001600160a01b031660009081526044602052604090205490565b905060006109e382846131f5565b90506109f0853383611779565b5050505050565b6003805460048054919291610a0b90613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3790613208565b8015610a845780601f10610a5957610100808354040283529160200191610a84565b820191906000526020600020905b815481529060010190602001808311610a6757829003601f168201915b5050505050905082565b600061094c826117b3565b610aa16128b8565b61094c826117f4565b610ab26118ed565b33610abc81611292565b60055462010000900460ff1615610ae657604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610b079082613288565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610b3f929190613347565b60405180910390a1505050565b6060816001600160401b03811115610b6657610b66612937565b604051908082528060200260200182016040528015610b9957816020015b6060815260200190600190039081610b845790505b50905060005b82811015610c3957610c0930858584818110610bbd57610bbd6133ec565b9050602002810190610bcf9190613402565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061191892505050565b828281518110610c1b57610c1b6133ec565b60200260200101819052508080610c319061344f565b915050610b9f565b5092915050565b81518151606091908114610c6757604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610c8157610c81612937565b604051908082528060200260200182016040528015610cc657816020015b6040805180820190915260008082526020820152815260200190600190039081610c9f5790505b50905060005b82811015610d3557610d10868281518110610ce957610ce96133ec565b6020026020010151868381518110610d0357610d036133ec565b602002602001015161193d565b828281518110610d2257610d226133ec565b6020908102919091010152600101610ccc565b50949350505050565b610d466119f8565b610d4e6118ed565b8060005b81811015610f91576000848483818110610d6e57610d6e6133ec565b905060400201803603810190610d849190613468565b80516001600160a01b039081166000908152600f602090815260408083208151606081018352815460ff81161515825261010090049095168584015281518083018352600182018054825260028301805498995095979295938701949193909291840191610df190613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610e1d90613208565b8015610e6a5780601f10610e3f57610100808354040283529160200191610e6a565b820191906000526020600020905b815481529060010190602001808311610e4d57829003601f168201915b5050509190925250505090525082516001600160a01b03908116600090815260436020908152604080832082880151909416835292905290812054919250819003610ec857604051637fcce2a960e01b815260040160405180910390fd5b6020808401805185516001600160a01b03908116600090815260438552604080822094518316825293855283812081905590821681526044909352908220805491928492610f179084906131f5565b92505081905550610f2d81846020015184611779565b8351602084810151604080516001600160a01b03928316815292830186905284821683820152519216917f0ffa55c11cec5055a4f567b0ff6e1e0eef2af17baafddd35f31ab4ed1afb75469181900360600190a2505060019092019150610d529050565b5050610f9d6001601155565b5050565b6000610fab611a51565b905090565b600061094c82611a9a565b610fc3611148565b600081806020019051810190610fd99190613538565b9050610fe58382611ab9565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610b3f929190612cfb565b61101e611148565b611026611193565b6110308282611d67565b610f9d8282611f46565b6110426120fd565b3361104c81611292565b600854821461106e57604051637fcce2a960e01b815260040160405180910390fd5b60005b835181101561111857600084828151811061108e5761108e6133ec565b602002602001015160000151905060008583815181106110b0576110b06133ec565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101611071565b50505050565b611126611148565b8060026000828254611138919061360a565b9091555061114590508181565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111915760405163075fd2b160e01b815260040160405180910390fd5b565b60015460000361119157604051630f68fe6360e21b815260040160405180910390fd5b806111c081611292565b600a546000036111e357604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16611205576005805462ff00001916620100001790555b60008380602001905181019061121b91906136df565b805190915060005b818110156112555761124d838281518110611240576112406133ec565b6020026020010151612128565b600101611223565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015611303573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611327919061378f565b6111455760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b031642118061136c5750826001600160401b0316846001600160401b0316115b806113885750816001600160401b0316846001600160401b0316115b806113a45750806001600160401b0316826001600160401b0316115b806113c05750806001600160401b0316836001600160401b0316115b1561111857604051637fcce2a960e01b815260040160405180910390fd5b60006113e86122be565b600080600061140a604051806040016040528060008152602001606081525090565b60055460ff161561145c57868060200190518101906114299190613840565b9196509350905061143a858761230e565b6114575760405163075fd2b160e01b815260040160405180910390fd5b6114c7565b868060200190518101906114709190613840565b6001600160a01b038316151596509094509092509050836114915785611493565b815b94508380156114a957506114a7858761230e565b155b156114c75760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156114ea575060208101515115806114ea57508051155b156115085760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b03831661153f5760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff00199093169290921782558251600183019081559083015183919060028401906115a39082613288565b505060055460ff1690506115b757846115ba565b60015b815460ff19169015151781556001600160a01b0386166000908152600c60205260408120549003611696576008546001600160a01b0387166000908152600c60205260409020556116108660015b60ff16612406565b6000886008546040516020016116279291906138a3565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a6040516116739291906138c5565b60405180910390a26008805490600061168b8361344f565b919050555050611725565b60006116a187612439565b905060011960ff8216016116bf576116ba876001611608565b6116d6565b60021960ff8216016116d6576116d6876004611608565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a61170c8b612439565b60405161171b939291906138f0565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161176857506001600160a01b0381163161094c565b611772838361247a565b905061094c565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016117a85761082b82826124af565b61082b8383836124cb565b6000806117c26101008461393b565b905060006117d26101008561394f565b6000928352600d602052604090922054600190921b9182169091149392505050565b6117fc6128b8565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161186190613208565b80601f016020809104026020016040519081016040528092919081815260200182805461188d90613208565b80156118da5780601f106118af576101008083540402835291602001916118da565b820191906000526020600020905b8154815290600101906020018083116118bd57829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b0316421161119157604051634543ced160e11b815260040160405180910390fd5b60606109498383604051806060016040528060278152602001613ce46027913961251a565b60408051808201909152600080825260208201526000828060200190518101906119679190613963565b80516020820151604083015160608401519394509192909190600061198b846117f4565b60200151905061199e8585838686612592565b156119ce576040518060400160405280826001600160a01b0316815260200184815250965050505050505061094c565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b600260115403611a4a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611536565b6002601155565b6005546000904263010000009091046001600160401b031611801590611a895750600554600160581b90046001600160401b03164211155b15611a945750600190565b50600090565b6000611aa582612439565b60ff16600681111561094c5761094c613081565b611ac28261263b565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190613997565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff19169187169182179055611c4d959185048216949283048216939092041690611344565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c0810151516000819003611d065760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015611118576001600e60008560c001518481518110611d2d57611d2d6133ec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611d09565b611d6f61268a565b60008083806020019051810190611d8691906139b4565b80515160208101519051929450909250906002611da285612439565b60ff166006811115611db657611db6613081565b6006811115611dc757611dc7613081565b14611df05760405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b6001600160a01b0381166000908152600e602052604090205460ff16158015611e44575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611e6257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611e8f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611ec157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611ec15750813414155b15611edf57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611f36939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611f5d91906139b4565b8051518051602090910151929450909250908073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601611fc55781341015611fb6576040516374c5672b60e01b815260040160405180910390fd5b611fc030836124af565b61208b565b6000611fd1843061247a565b85516040805180820182523081526020808201889052890151915163187945bd60e11b81529394506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936330f28b7a9361203c939092918d9190600401613aa1565b600060405180830381600087803b15801561205657600080fd5b505af115801561206a573d6000803e3d6000fd5b50505050600061207a853061247a565b905061208682826131f5565b925050505b6001600160a01b038086166000908152604360209081526040808320938716835292905290812080548392906120c290849061360a565b90915550506001600160a01b038316600090815260446020526040812080548392906120ef90849061360a565b909155505050505050505050565b6006546001600160401b03164211156111915760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f90965292909420549293909290916101009091041661216f8585838686612592565b156122925760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d916121c89160040190815260200190565b600060405180830381865afa1580156121e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261220d9190810190613b24565b9050612218866126d2565b836002600082825461222a91906131f5565b9091555050604081015161223f908386611779565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a3506122b6565b60405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b505050505050565b6005544263010000009091046001600160401b031611806122f05750600554600160581b90046001600160401b031642115b1561119157604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa15801561235c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123849190810190613bd7565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa1580156123da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fe919061378f565b949350505050565b600080600061241485612710565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361246057506000919050565b60008061246c84612710565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610f9d5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d156001600051141716612510576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b0316856040516125379190613c9d565b600060405180830381855af49150503d8060008114612572576040519150601f19603f3d011682016040523d82523d6000602084013e612577565b606091505b509150915061258886838387612783565b9695505050505050565b600061259d866117b3565b156125aa57506000612632565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061261e83600a54836127fc565b61262c576000915050612632565b60019150505b95945050505050565b612643611148565b600154156126645760405163439a74c960e01b815260040160405180910390fd5b8060000361268557604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806126b557506006546001600160401b031642115b156111915760405162b828c960e81b815260040160405180910390fd5b60006126e06101008361393b565b905060006126f06101008461394f565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061273b906001906131f5565b9050600061274a60408361393b565b9050600061275960408461394f565b612764906004613cb9565b6000838152600b60205260409020549298909750919550909350505050565b606083156127f25782516000036127eb576001600160a01b0385163b6127eb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611536565b50816123fe565b6123fe8383612812565b600082612809858461283c565b14949350505050565b8151156128225781518083602001fd5b8060405162461bcd60e51b81526004016115369190613cd0565b600081815b84518110156128815761286d82868381518110612860576128606133ec565b6020026020010151612889565b9150806128798161344f565b915050612841565b509392505050565b60008183106128a5576000828152602084905260409020610949565b6000838152602083905260409020610949565b604051806060016040528060001515815260200160006001600160a01b031681526020016128f9604051806040016040528060008152602001606081525090565b905290565b6001600160a01b038116811461114557600080fd5b60006020828403121561292557600080fd5b8135612930816128fe565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561296f5761296f612937565b60405290565b60405160e081016001600160401b038111828210171561296f5761296f612937565b604051608081016001600160401b038111828210171561296f5761296f612937565b604051606081016001600160401b038111828210171561296f5761296f612937565b60405160c081016001600160401b038111828210171561296f5761296f612937565b604051601f8201601f191681016001600160401b0381118282101715612a2557612a25612937565b604052919050565b60006001600160401b03821115612a4657612a46612937565b5060051b60200190565b600082601f830112612a6157600080fd5b81356020612a76612a7183612a2d565b6129fd565b82815260059290921b84018101918181019086841115612a9557600080fd5b8286015b84811015612ab9578035612aac816128fe565b8352918301918301612a99565b509695505050505050565b60006001600160401b03821115612add57612add612937565b50601f01601f191660200190565b6000612af9612a7184612ac4565b9050828152838383011115612b0d57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b3557600080fd5b61094983833560208501612aeb565b600080600060608486031215612b5957600080fd5b83356001600160401b0380821115612b7057600080fd5b612b7c87838801612a50565b94506020860135915080821115612b9257600080fd5b50612b9f86828701612b24565b9250506040840135612bb0816128fe565b809150509250925092565b6001600160401b038116811461114557600080fd5b60008060008060808587031215612be657600080fd5b8435612bf181612bbb565b93506020850135612c0181612bbb565b92506040850135612c1181612bbb565b91506060850135612c2181612bbb565b939692955090935050565b60008060408385031215612c3f57600080fd5b82356001600160401b03811115612c5557600080fd5b612c6185828601612b24565b9250506020830135612c72816128fe565b809150509250929050565b60008060408385031215612c9057600080fd5b8235612c9b816128fe565b91506020830135612c72816128fe565b60005b83811015612cc6578181015183820152602001612cae565b50506000910152565b60008151808452612ce7816020860160208601612cab565b601f01601f19169290920160200192915050565b8281526040602082015260006123fe6040830184612ccf565b600060208284031215612d2657600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a08401526123fe60c0840182612ccf565b60008060408385031215612d8f57600080fd5b8235915060208301356001600160401b0380821115612dad57600080fd5b9084019060408287031215612dc157600080fd5b612dc961294d565b82358152602083013582811115612ddf57600080fd5b80840193505086601f840112612df457600080fd5b612e0387843560208601612aeb565b60208201528093505050509250929050565b60008060208385031215612e2857600080fd5b82356001600160401b0380821115612e3f57600080fd5b818501915085601f830112612e5357600080fd5b813581811115612e6257600080fd5b8660208260051b8501011115612e7757600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612ede57603f19888603018452612ecc858351612ccf565b94509285019290850190600101612eb0565b5092979650505050505050565b60008060408385031215612efe57600080fd5b82356001600160401b0380821115612f1557600080fd5b612f2186838701612a50565b9350602091508185013581811115612f3857600080fd5b8501601f81018713612f4957600080fd5b8035612f57612a7182612a2d565b81815260059190911b82018401908481019089831115612f7657600080fd5b8584015b83811015612fae57803586811115612f925760008081fd5b612fa08c8983890101612b24565b845250918601918601612f7a565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b828110156130125761300284835180516001600160a01b03168252602090810151910152565b9284019290850190600101612fdc565b5091979650505050505050565b6000806020838503121561303257600080fd5b82356001600160401b038082111561304957600080fd5b818501915085601f83011261305d57600080fd5b81358181111561306c57600080fd5b8660208260061b8501011115612e7757600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600783106130b957634e487b7160e01b600052602160045260246000fd5b91905290565b600080604083850312156130d257600080fd5b8235915060208301356001600160401b038111156130ef57600080fd5b6130fb85828601612b24565b9150509250929050565b600080604080848603121561311957600080fd5b83356001600160401b0381111561312f57600080fd5b8401601f8101861361314057600080fd5b80356020613150612a7183612a2d565b82815260069290921b8301810191818101908984111561316f57600080fd5b938201935b838510156131af5785858b03121561318c5760008081fd5b61319461294d565b85358152838601358482015282529385019390820190613174565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610c3957610c396131bf565b8181038181111561094c5761094c6131bf565b600181811c9082168061321c57607f821691505b60208210810361323c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561082b57600081815260208120601f850160051c810160208610156132695750805b601f850160051c820191505b818110156122b657828155600101613275565b81516001600160401b038111156132a1576132a1612937565b6132b5816132af8454613208565b84613242565b602080601f8311600181146132ea57600084156132d25750858301515b600019600386901b1c1916600185901b1785556122b6565b600085815260208120601f198616915b82811015613319578886015182559484019460019091019084016132fa565b50858210156133375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b82815260006020604081840152835460408401526001808501604060608601526000815461337481613208565b80608089015260a08583166000811461339457600181146133ae576133dc565b60ff1984168a83015282151560051b8a01820194506133dc565b856000528760002060005b848110156133d45781548c82018501529088019089016133b9565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261341957600080fd5b8301803591506001600160401b0382111561343357600080fd5b60200191503681900382131561344857600080fd5b9250929050565b600060018201613461576134616131bf565b5060010190565b60006040828403121561347a57600080fd5b61348261294d565b823561348d816128fe565b8152602083013561349d816128fe565b60208201529392505050565b805180151581146134b957600080fd5b919050565b80516134b981612bbb565b80516134b9816128fe565b600082601f8301126134e557600080fd5b815160206134f5612a7183612a2d565b82815260059290921b8401810191818101908684111561351457600080fd5b8286015b84811015612ab957805161352b816128fe565b8352918301918301613518565b60006020828403121561354a57600080fd5b81516001600160401b038082111561356157600080fd5b9083019060e0828603121561357557600080fd5b61357d612975565b613586836134a9565b8152613594602084016134a9565b60208201526135a5604084016134be565b60408201526135b6606084016134be565b60608201526135c7608084016134be565b60808201526135d860a084016134be565b60a082015260c0830151828111156135ef57600080fd5b6135fb878286016134d4565b60c08301525095945050505050565b8082018082111561094c5761094c6131bf565b60006080828403121561362f57600080fd5b613637612997565b90508151815260208083015161364c816128fe565b828201526040838101519083015260608301516001600160401b0381111561367357600080fd5b8301601f8101851361368457600080fd5b8051613692612a7182612a2d565b81815260059190911b820183019083810190878311156136b157600080fd5b928401925b828410156136cf578351825292840192908401906136b6565b6060860152509295945050505050565b600060208083850312156136f257600080fd5b82516001600160401b038082111561370957600080fd5b818501915085601f83011261371d57600080fd5b815161372b612a7182612a2d565b81815260059190911b8301840190848101908883111561374a57600080fd5b8585015b83811015613782578051858111156137665760008081fd5b6137748b89838a010161361d565b84525091860191860161374e565b5098975050505050505050565b6000602082840312156137a157600080fd5b610949826134a9565b600082601f8301126137bb57600080fd5b81516137c9612a7182612ac4565b8181528460208386010111156137de57600080fd5b6123fe826020830160208701612cab565b60006040828403121561380157600080fd5b61380961294d565b90508151815260208201516001600160401b0381111561382857600080fd5b613834848285016137aa565b60208301525092915050565b60008060006060848603121561385557600080fd5b8351613860816128fe565b6020850151909350613871816128fe565b60408501519092506001600160401b0381111561388d57600080fd5b613899868287016137ef565b9150509250925092565b6040815260006138b66040830185612ccf565b90508260208301529392505050565b6040815260006138d86040830185612ccf565b90506001600160a01b03831660208301529392505050565b6060815260006139036060830186612ccf565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261394a5761394a613925565b500490565b60008261395e5761395e613925565b500690565b60006020828403121561397557600080fd5b81516001600160401b0381111561398b57600080fd5b6123fe8482850161361d565b6000602082840312156139a957600080fd5b8151612930816128fe565b600080604083850312156139c757600080fd5b82516139d2816128fe565b60208401519092506001600160401b03808211156139ef57600080fd5b9084019081860360a0811215613a0457600080fd5b613a0c61294d565b6080821215613a1a57600080fd5b613a226129b9565b6040831215613a3057600080fd5b613a3861294d565b92508451613a45816128fe565b80845250602085015160208401528281526040850151602082015260608501516040820152808252506080840151915082821115613a8257600080fd5b613a8e888386016137aa565b6020820152809450505050509250929050565b6000610100613ac483885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613af8608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613b1981840185612ccf565b979650505050505050565b600060208284031215613b3657600080fd5b81516001600160401b0380821115613b4d57600080fd5b9083019060c08286031215613b6157600080fd5b613b696129db565b825181526020830151613b7b816128fe565b60208201526040830151613b8e816128fe565b6040820152606083015182811115613ba557600080fd5b613bb1878286016137ef565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b600060208284031215613be957600080fd5b81516001600160401b0380821115613c0057600080fd5b9083019060c08286031215613c1457600080fd5b613c1c6129db565b8251815260208301516020820152604083015182811115613c3c57600080fd5b613c48878286016137aa565b604083015250606083015182811115613c6057600080fd5b613c6c878286016137ef565b606083015250613c7e608084016134c9565b6080820152613c8f60a084016134c9565b60a082015295945050505050565b60008251613caf818460208701612cab565b9190910192915050565b808202811582820484141761094c5761094c6131bf565b6020815260006109496020830184612ccf56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e54d4f5d1215084dfd06cbe16897419283743e107aae5cef8af599b3032c82c064736f6c63430008130033"; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.js b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.js new file mode 100644 index 0000000..682c4ff --- /dev/null +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.js @@ -0,0 +1,1248 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bytecode = exports.abi = void 0; +// uses Vault abi, since it's the same like direct transfer + an additional claim function +exports.abi = [ + { + inputs: [ + { + internalType: "address", + name: "_allo", + type: "address", + }, + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "contract ISignatureTransfer", + name: "_permit2", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ALLOCATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ENDED", + type: "error", + }, + { + inputs: [], + name: "ALREADY_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "AMOUNT_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "ANCHOR_ERROR", + type: "error", + }, + { + inputs: [], + name: "ARRAY_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "INVALID", + type: "error", + }, + { + inputs: [], + name: "INVALID_ADDRESS", + type: "error", + }, + { + inputs: [], + name: "INVALID_FEE", + type: "error", + }, + { + inputs: [], + name: "INVALID_METADATA", + type: "error", + }, + { + inputs: [], + name: "INVALID_REGISTRATION", + type: "error", + }, + { + inputs: [], + name: "IS_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "MISMATCH", + type: "error", + }, + { + inputs: [], + name: "NONCE_NOT_AVAILABLE", + type: "error", + }, + { + inputs: [], + name: "NOT_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "NOT_ENOUGH_FUNDS", + type: "error", + }, + { + inputs: [], + name: "NOT_IMPLEMENTED", + type: "error", + }, + { + inputs: [], + name: "NOT_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "NOT_PENDING_OWNER", + type: "error", + }, + { + inputs: [], + name: "POOL_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "POOL_INACTIVE", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_ALREADY_ACCEPTED", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "RECIPIENT_ERROR", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_NOT_ACCEPTED", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "UNAUTHORIZED", + type: "error", + }, + { + inputs: [], + name: "ZERO_ADDRESS", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Allocated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "BatchPayoutSuccessful", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "Claimed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Distributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + name: "DistributionUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "grantee", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "FundsDistributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "version", + type: "uint8", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "poolId", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool", + }, + ], + name: "PoolActive", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "rowIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fullRow", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RecipientStatusUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Registered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "registrationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "registrationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "TimestampsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint8", + name: "status", + type: "uint8", + }, + ], + name: "UpdatedRegistration", + type: "event", + }, + { + inputs: [], + name: "NATIVE", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT2", + outputs: [ + { + internalType: "contract ISignatureTransfer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "allocate", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "allocationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allocationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct DonationVotingMerkleDistributionVaultStrategy.Claim[]", + name: "_claims", + type: "tuple[]", + }, + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "claims", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "distribute", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributionMetadata", + outputs: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "distributionStarted", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAllo", + outputs: [ + { + internalType: "contract IAllo", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "_data", + type: "bytes[]", + }, + ], + name: "getPayouts", + outputs: [ + { + components: [ + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + internalType: "struct IStrategy.PayoutSummary[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipient", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "useRegistryAnchor", + type: "bool", + }, + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + internalType: "struct DonationVotingMerkleDistributionBaseStrategy.Recipient", + name: "recipient", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipientStatus", + outputs: [ + { + internalType: "enum IStrategy.Status", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getStrategyId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_index", + type: "uint256", + }, + ], + name: "hasBeenDistributed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "increasePoolAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_poolId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isDistributionSet", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isPoolActive", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_allocator", + type: "address", + }, + ], + name: "isValidAllocator", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "merkleRoot", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "metadataRequired", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "recipientToStatusIndexes", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "recipientsCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "registerRecipient", + outputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "registrationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "registrationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "statusRow", + type: "uint256", + }, + ], + internalType: "struct DonationVotingMerkleDistributionBaseStrategy.ApplicationStatus[]", + name: "statuses", + type: "tuple[]", + }, + { + internalType: "uint256", + name: "refRecipientsCounter", + type: "uint256", + }, + ], + name: "reviewRecipients", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "statusesBitMap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "totalClaimableAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalPayoutAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "_distributionMetadata", + type: "tuple", + }, + ], + name: "updateDistribution", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "_registrationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_registrationEndTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationEndTime", + type: "uint64", + }, + ], + name: "updatePoolTimestamps", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useRegistryAnchor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +]; +exports.bytecode = "0x60e060405260016008553480156200001657600080fd5b5060405162003fd138038062003fd1833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c051613d40620002916000396000818161055a0152612003015260006103e00152600081816102bc01528181611153015281816112bc01528181611b0001526121910152613d406000f3fe60806040526004361061023f5760003560e01c80636afdd8501161012e578063df868ed3116100ab578063edd146cc1161006f578063edd146cc14610770578063ef2920fc14610790578063f31db3d1146107a3578063f5b0dfb7146107c3578063f6f25891146107e357600080fd5b8063df868ed3146106c1578063dff7d2c7146106d6578063e744092e146106fd578063e7efcfc21461072d578063eb11af931461074357600080fd5b8063ac9650d8116100f2578063ac9650d814610601578063b2b878d01461062e578063cb0e85a61461065b578063d26839371461067a578063d2e17f591461069a57600080fd5b80636afdd8501461054857806373af34531461057c57806395355b3b1461059c5780639af5c09d146105b2578063a0cf0aea146105d957600080fd5b806342fda9c7116101bc5780635708973911610180578063570897391461049157806359a3977b146104ab5780635f1b55f3146104ce57806362812a39146104ee5780636923e09a1461051b57600080fd5b806342fda9c7146103d15780634533d678146104045780634ab4ba421461043c5780634d31d0871461045157806351cff8d91461047157600080fd5b80632bbe0cae116102035780632bbe0cae146103445780632d52eff2146103575780632eb4a7ab1461036e57806338fff2d0146103845780633f733c6b1461039957600080fd5b806301fc1c641461024b5780630a6f0ee91461028b57806315cc481e146102ad5780632143e92f146102f4578063217550881461031457600080fd5b3661024657005b600080fd5b34801561025757600080fd5b50610278610266366004612913565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561029757600080fd5b506102ab6102a6366004612b44565b610810565b005b3480156102b957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610282565b34801561030057600080fd5b506102ab61030f366004612bd0565b610830565b34801561032057600080fd5b506005546103349062010000900460ff1681565b6040519015158152602001610282565b6102dc610352366004612c2c565b61092d565b34801561036357600080fd5b50600a541515610334565b34801561037a57600080fd5b50610278600a5481565b34801561039057600080fd5b50600154610278565b3480156103a557600080fd5b506102786103b4366004612c7d565b604360209081526000928352604080842090915290825290205481565b3480156103dd57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610278565b34801561041057600080fd5b50600654610424906001600160401b031681565b6040516001600160401b039091168152602001610282565b34801561044857600080fd5b50600254610278565b34801561045d57600080fd5b5061033461046c366004612913565b610952565b34801561047d57600080fd5b506102ab61048c366004612913565b61095b565b34801561049d57600080fd5b506005546103349060ff1681565b3480156104b757600080fd5b506104c06109f7565b604051610282929190612cfb565b3480156104da57600080fd5b506103346104e9366004612d14565b610a8e565b3480156104fa57600080fd5b5061050e610509366004612913565b610a99565b6040516102829190612d2d565b34801561052757600080fd5b50610278610536366004612913565b60446020526000908152604090205481565b34801561055457600080fd5b506102dc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058857600080fd5b506102ab610597366004612d7c565b610aaa565b3480156105a857600080fd5b5061027860085481565b3480156105be57600080fd5b5060055461042490630100000090046001600160401b031681565b3480156105e557600080fd5b506102dc73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561060d57600080fd5b5061062161061c366004612e15565b610b4c565b6040516102829190612e89565b34801561063a57600080fd5b5061064e610649366004612eeb565b610c40565b6040516102829190612fbf565b34801561066757600080fd5b5060055461033490610100900460ff1681565b34801561068657600080fd5b506102ab61069536600461301f565b610d3e565b3480156106a657600080fd5b5060055461042490600160981b90046001600160401b031681565b3480156106cd57600080fd5b50610334610fa1565b3480156106e257600080fd5b5060055461042490600160581b90046001600160401b031681565b34801561070957600080fd5b50610334610718366004612913565b600e6020526000908152604090205460ff1681565b34801561073957600080fd5b5061027860075481565b34801561074f57600080fd5b5061076361075e366004612913565b610fb0565b6040516102829190613097565b34801561077c57600080fd5b506102ab61078b3660046130bf565b610fbb565b6102ab61079e366004612c2c565b611016565b3480156107af57600080fd5b506102ab6107be366004613105565b61103a565b3480156107cf57600080fd5b506102ab6107de366004612d14565b61111e565b3480156107ef57600080fd5b506102786107fe366004612d14565b600b6020526000908152604090205481565b610818611148565b610820611193565b61082b8383836111b6565b505050565b3361083a81611292565b61084685858585611344565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610937611148565b61093f611193565b61094983836113de565b90505b92915050565b6000600161094c565b3361096581611292565b60065461097e906001600160401b031662278d006131d5565b6001600160401b031642116109a657604051637fcce2a960e01b815260040160405180910390fd5b60006109b28330611730565b905060006109d5846001600160a01b031660009081526044602052604090205490565b905060006109e382846131f5565b90506109f0853383611779565b5050505050565b6003805460048054919291610a0b90613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3790613208565b8015610a845780601f10610a5957610100808354040283529160200191610a84565b820191906000526020600020905b815481529060010190602001808311610a6757829003601f168201915b5050505050905082565b600061094c826117b3565b610aa16128b8565b61094c826117f4565b610ab26118ed565b33610abc81611292565b60055462010000900460ff1615610ae657604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610b079082613288565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610b3f929190613347565b60405180910390a1505050565b6060816001600160401b03811115610b6657610b66612937565b604051908082528060200260200182016040528015610b9957816020015b6060815260200190600190039081610b845790505b50905060005b82811015610c3957610c0930858584818110610bbd57610bbd6133ec565b9050602002810190610bcf9190613402565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061191892505050565b828281518110610c1b57610c1b6133ec565b60200260200101819052508080610c319061344f565b915050610b9f565b5092915050565b81518151606091908114610c6757604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610c8157610c81612937565b604051908082528060200260200182016040528015610cc657816020015b6040805180820190915260008082526020820152815260200190600190039081610c9f5790505b50905060005b82811015610d3557610d10868281518110610ce957610ce96133ec565b6020026020010151868381518110610d0357610d036133ec565b602002602001015161193d565b828281518110610d2257610d226133ec565b6020908102919091010152600101610ccc565b50949350505050565b610d466119f8565b610d4e6118ed565b8060005b81811015610f91576000848483818110610d6e57610d6e6133ec565b905060400201803603810190610d849190613468565b80516001600160a01b039081166000908152600f602090815260408083208151606081018352815460ff81161515825261010090049095168584015281518083018352600182018054825260028301805498995095979295938701949193909291840191610df190613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610e1d90613208565b8015610e6a5780601f10610e3f57610100808354040283529160200191610e6a565b820191906000526020600020905b815481529060010190602001808311610e4d57829003601f168201915b5050509190925250505090525082516001600160a01b03908116600090815260436020908152604080832082880151909416835292905290812054919250819003610ec857604051637fcce2a960e01b815260040160405180910390fd5b6020808401805185516001600160a01b03908116600090815260438552604080822094518316825293855283812081905590821681526044909352908220805491928492610f179084906131f5565b92505081905550610f2d81846020015184611779565b8351602084810151604080516001600160a01b03928316815292830186905284821683820152519216917f0ffa55c11cec5055a4f567b0ff6e1e0eef2af17baafddd35f31ab4ed1afb75469181900360600190a2505060019092019150610d529050565b5050610f9d6001601155565b5050565b6000610fab611a51565b905090565b600061094c82611a9a565b610fc3611148565b600081806020019051810190610fd99190613538565b9050610fe58382611ab9565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610b3f929190612cfb565b61101e611148565b611026611193565b6110308282611d67565b610f9d8282611f46565b6110426120fd565b3361104c81611292565b600854821461106e57604051637fcce2a960e01b815260040160405180910390fd5b60005b835181101561111857600084828151811061108e5761108e6133ec565b602002602001015160000151905060008583815181106110b0576110b06133ec565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101611071565b50505050565b611126611148565b8060026000828254611138919061360a565b9091555061114590508181565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111915760405163075fd2b160e01b815260040160405180910390fd5b565b60015460000361119157604051630f68fe6360e21b815260040160405180910390fd5b806111c081611292565b600a546000036111e357604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16611205576005805462ff00001916620100001790555b60008380602001905181019061121b91906136df565b805190915060005b818110156112555761124d838281518110611240576112406133ec565b6020026020010151612128565b600101611223565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015611303573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611327919061378f565b6111455760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b031642118061136c5750826001600160401b0316846001600160401b0316115b806113885750816001600160401b0316846001600160401b0316115b806113a45750806001600160401b0316826001600160401b0316115b806113c05750806001600160401b0316836001600160401b0316115b1561111857604051637fcce2a960e01b815260040160405180910390fd5b60006113e86122be565b600080600061140a604051806040016040528060008152602001606081525090565b60055460ff161561145c57868060200190518101906114299190613840565b9196509350905061143a858761230e565b6114575760405163075fd2b160e01b815260040160405180910390fd5b6114c7565b868060200190518101906114709190613840565b6001600160a01b038316151596509094509092509050836114915785611493565b815b94508380156114a957506114a7858761230e565b155b156114c75760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156114ea575060208101515115806114ea57508051155b156115085760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b03831661153f5760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff00199093169290921782558251600183019081559083015183919060028401906115a39082613288565b505060055460ff1690506115b757846115ba565b60015b815460ff19169015151781556001600160a01b0386166000908152600c60205260408120549003611696576008546001600160a01b0387166000908152600c60205260409020556116108660015b60ff16612406565b6000886008546040516020016116279291906138a3565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a6040516116739291906138c5565b60405180910390a26008805490600061168b8361344f565b919050555050611725565b60006116a187612439565b905060011960ff8216016116bf576116ba876001611608565b6116d6565b60021960ff8216016116d6576116d6876004611608565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a61170c8b612439565b60405161171b939291906138f0565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161176857506001600160a01b0381163161094c565b611772838361247a565b905061094c565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016117a85761082b82826124af565b61082b8383836124cb565b6000806117c26101008461393b565b905060006117d26101008561394f565b6000928352600d602052604090922054600190921b9182169091149392505050565b6117fc6128b8565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161186190613208565b80601f016020809104026020016040519081016040528092919081815260200182805461188d90613208565b80156118da5780601f106118af576101008083540402835291602001916118da565b820191906000526020600020905b8154815290600101906020018083116118bd57829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b0316421161119157604051634543ced160e11b815260040160405180910390fd5b60606109498383604051806060016040528060278152602001613ce46027913961251a565b60408051808201909152600080825260208201526000828060200190518101906119679190613963565b80516020820151604083015160608401519394509192909190600061198b846117f4565b60200151905061199e8585838686612592565b156119ce576040518060400160405280826001600160a01b0316815260200184815250965050505050505061094c565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b600260115403611a4a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611536565b6002601155565b6005546000904263010000009091046001600160401b031611801590611a895750600554600160581b90046001600160401b03164211155b15611a945750600190565b50600090565b6000611aa582612439565b60ff16600681111561094c5761094c613081565b611ac28261263b565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190613997565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff19169187169182179055611c4d959185048216949283048216939092041690611344565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c0810151516000819003611d065760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015611118576001600e60008560c001518481518110611d2d57611d2d6133ec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611d09565b611d6f61268a565b60008083806020019051810190611d8691906139b4565b80515160208101519051929450909250906002611da285612439565b60ff166006811115611db657611db6613081565b6006811115611dc757611dc7613081565b14611df05760405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b6001600160a01b0381166000908152600e602052604090205460ff16158015611e44575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611e6257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611e8f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611ec157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611ec15750813414155b15611edf57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611f36939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611f5d91906139b4565b8051518051602090910151929450909250908073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601611fc55781341015611fb6576040516374c5672b60e01b815260040160405180910390fd5b611fc030836124af565b61208b565b6000611fd1843061247a565b85516040805180820182523081526020808201889052890151915163187945bd60e11b81529394506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936330f28b7a9361203c939092918d9190600401613aa1565b600060405180830381600087803b15801561205657600080fd5b505af115801561206a573d6000803e3d6000fd5b50505050600061207a853061247a565b905061208682826131f5565b925050505b6001600160a01b038086166000908152604360209081526040808320938716835292905290812080548392906120c290849061360a565b90915550506001600160a01b038316600090815260446020526040812080548392906120ef90849061360a565b909155505050505050505050565b6006546001600160401b03164211156111915760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f90965292909420549293909290916101009091041661216f8585838686612592565b156122925760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d916121c89160040190815260200190565b600060405180830381865afa1580156121e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261220d9190810190613b24565b9050612218866126d2565b836002600082825461222a91906131f5565b9091555050604081015161223f908386611779565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a3506122b6565b60405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b505050505050565b6005544263010000009091046001600160401b031611806122f05750600554600160581b90046001600160401b031642115b1561119157604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa15801561235c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123849190810190613bd7565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa1580156123da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fe919061378f565b949350505050565b600080600061241485612710565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361246057506000919050565b60008061246c84612710565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610f9d5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d156001600051141716612510576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b0316856040516125379190613c9d565b600060405180830381855af49150503d8060008114612572576040519150601f19603f3d011682016040523d82523d6000602084013e612577565b606091505b509150915061258886838387612783565b9695505050505050565b600061259d866117b3565b156125aa57506000612632565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061261e83600a54836127fc565b61262c576000915050612632565b60019150505b95945050505050565b612643611148565b600154156126645760405163439a74c960e01b815260040160405180910390fd5b8060000361268557604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806126b557506006546001600160401b031642115b156111915760405162b828c960e81b815260040160405180910390fd5b60006126e06101008361393b565b905060006126f06101008461394f565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061273b906001906131f5565b9050600061274a60408361393b565b9050600061275960408461394f565b612764906004613cb9565b6000838152600b60205260409020549298909750919550909350505050565b606083156127f25782516000036127eb576001600160a01b0385163b6127eb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611536565b50816123fe565b6123fe8383612812565b600082612809858461283c565b14949350505050565b8151156128225781518083602001fd5b8060405162461bcd60e51b81526004016115369190613cd0565b600081815b84518110156128815761286d82868381518110612860576128606133ec565b6020026020010151612889565b9150806128798161344f565b915050612841565b509392505050565b60008183106128a5576000828152602084905260409020610949565b6000838152602083905260409020610949565b604051806060016040528060001515815260200160006001600160a01b031681526020016128f9604051806040016040528060008152602001606081525090565b905290565b6001600160a01b038116811461114557600080fd5b60006020828403121561292557600080fd5b8135612930816128fe565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561296f5761296f612937565b60405290565b60405160e081016001600160401b038111828210171561296f5761296f612937565b604051608081016001600160401b038111828210171561296f5761296f612937565b604051606081016001600160401b038111828210171561296f5761296f612937565b60405160c081016001600160401b038111828210171561296f5761296f612937565b604051601f8201601f191681016001600160401b0381118282101715612a2557612a25612937565b604052919050565b60006001600160401b03821115612a4657612a46612937565b5060051b60200190565b600082601f830112612a6157600080fd5b81356020612a76612a7183612a2d565b6129fd565b82815260059290921b84018101918181019086841115612a9557600080fd5b8286015b84811015612ab9578035612aac816128fe565b8352918301918301612a99565b509695505050505050565b60006001600160401b03821115612add57612add612937565b50601f01601f191660200190565b6000612af9612a7184612ac4565b9050828152838383011115612b0d57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b3557600080fd5b61094983833560208501612aeb565b600080600060608486031215612b5957600080fd5b83356001600160401b0380821115612b7057600080fd5b612b7c87838801612a50565b94506020860135915080821115612b9257600080fd5b50612b9f86828701612b24565b9250506040840135612bb0816128fe565b809150509250925092565b6001600160401b038116811461114557600080fd5b60008060008060808587031215612be657600080fd5b8435612bf181612bbb565b93506020850135612c0181612bbb565b92506040850135612c1181612bbb565b91506060850135612c2181612bbb565b939692955090935050565b60008060408385031215612c3f57600080fd5b82356001600160401b03811115612c5557600080fd5b612c6185828601612b24565b9250506020830135612c72816128fe565b809150509250929050565b60008060408385031215612c9057600080fd5b8235612c9b816128fe565b91506020830135612c72816128fe565b60005b83811015612cc6578181015183820152602001612cae565b50506000910152565b60008151808452612ce7816020860160208601612cab565b601f01601f19169290920160200192915050565b8281526040602082015260006123fe6040830184612ccf565b600060208284031215612d2657600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a08401526123fe60c0840182612ccf565b60008060408385031215612d8f57600080fd5b8235915060208301356001600160401b0380821115612dad57600080fd5b9084019060408287031215612dc157600080fd5b612dc961294d565b82358152602083013582811115612ddf57600080fd5b80840193505086601f840112612df457600080fd5b612e0387843560208601612aeb565b60208201528093505050509250929050565b60008060208385031215612e2857600080fd5b82356001600160401b0380821115612e3f57600080fd5b818501915085601f830112612e5357600080fd5b813581811115612e6257600080fd5b8660208260051b8501011115612e7757600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612ede57603f19888603018452612ecc858351612ccf565b94509285019290850190600101612eb0565b5092979650505050505050565b60008060408385031215612efe57600080fd5b82356001600160401b0380821115612f1557600080fd5b612f2186838701612a50565b9350602091508185013581811115612f3857600080fd5b8501601f81018713612f4957600080fd5b8035612f57612a7182612a2d565b81815260059190911b82018401908481019089831115612f7657600080fd5b8584015b83811015612fae57803586811115612f925760008081fd5b612fa08c8983890101612b24565b845250918601918601612f7a565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b828110156130125761300284835180516001600160a01b03168252602090810151910152565b9284019290850190600101612fdc565b5091979650505050505050565b6000806020838503121561303257600080fd5b82356001600160401b038082111561304957600080fd5b818501915085601f83011261305d57600080fd5b81358181111561306c57600080fd5b8660208260061b8501011115612e7757600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600783106130b957634e487b7160e01b600052602160045260246000fd5b91905290565b600080604083850312156130d257600080fd5b8235915060208301356001600160401b038111156130ef57600080fd5b6130fb85828601612b24565b9150509250929050565b600080604080848603121561311957600080fd5b83356001600160401b0381111561312f57600080fd5b8401601f8101861361314057600080fd5b80356020613150612a7183612a2d565b82815260069290921b8301810191818101908984111561316f57600080fd5b938201935b838510156131af5785858b03121561318c5760008081fd5b61319461294d565b85358152838601358482015282529385019390820190613174565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610c3957610c396131bf565b8181038181111561094c5761094c6131bf565b600181811c9082168061321c57607f821691505b60208210810361323c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561082b57600081815260208120601f850160051c810160208610156132695750805b601f850160051c820191505b818110156122b657828155600101613275565b81516001600160401b038111156132a1576132a1612937565b6132b5816132af8454613208565b84613242565b602080601f8311600181146132ea57600084156132d25750858301515b600019600386901b1c1916600185901b1785556122b6565b600085815260208120601f198616915b82811015613319578886015182559484019460019091019084016132fa565b50858210156133375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b82815260006020604081840152835460408401526001808501604060608601526000815461337481613208565b80608089015260a08583166000811461339457600181146133ae576133dc565b60ff1984168a83015282151560051b8a01820194506133dc565b856000528760002060005b848110156133d45781548c82018501529088019089016133b9565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261341957600080fd5b8301803591506001600160401b0382111561343357600080fd5b60200191503681900382131561344857600080fd5b9250929050565b600060018201613461576134616131bf565b5060010190565b60006040828403121561347a57600080fd5b61348261294d565b823561348d816128fe565b8152602083013561349d816128fe565b60208201529392505050565b805180151581146134b957600080fd5b919050565b80516134b981612bbb565b80516134b9816128fe565b600082601f8301126134e557600080fd5b815160206134f5612a7183612a2d565b82815260059290921b8401810191818101908684111561351457600080fd5b8286015b84811015612ab957805161352b816128fe565b8352918301918301613518565b60006020828403121561354a57600080fd5b81516001600160401b038082111561356157600080fd5b9083019060e0828603121561357557600080fd5b61357d612975565b613586836134a9565b8152613594602084016134a9565b60208201526135a5604084016134be565b60408201526135b6606084016134be565b60608201526135c7608084016134be565b60808201526135d860a084016134be565b60a082015260c0830151828111156135ef57600080fd5b6135fb878286016134d4565b60c08301525095945050505050565b8082018082111561094c5761094c6131bf565b60006080828403121561362f57600080fd5b613637612997565b90508151815260208083015161364c816128fe565b828201526040838101519083015260608301516001600160401b0381111561367357600080fd5b8301601f8101851361368457600080fd5b8051613692612a7182612a2d565b81815260059190911b820183019083810190878311156136b157600080fd5b928401925b828410156136cf578351825292840192908401906136b6565b6060860152509295945050505050565b600060208083850312156136f257600080fd5b82516001600160401b038082111561370957600080fd5b818501915085601f83011261371d57600080fd5b815161372b612a7182612a2d565b81815260059190911b8301840190848101908883111561374a57600080fd5b8585015b83811015613782578051858111156137665760008081fd5b6137748b89838a010161361d565b84525091860191860161374e565b5098975050505050505050565b6000602082840312156137a157600080fd5b610949826134a9565b600082601f8301126137bb57600080fd5b81516137c9612a7182612ac4565b8181528460208386010111156137de57600080fd5b6123fe826020830160208701612cab565b60006040828403121561380157600080fd5b61380961294d565b90508151815260208201516001600160401b0381111561382857600080fd5b613834848285016137aa565b60208301525092915050565b60008060006060848603121561385557600080fd5b8351613860816128fe565b6020850151909350613871816128fe565b60408501519092506001600160401b0381111561388d57600080fd5b613899868287016137ef565b9150509250925092565b6040815260006138b66040830185612ccf565b90508260208301529392505050565b6040815260006138d86040830185612ccf565b90506001600160a01b03831660208301529392505050565b6060815260006139036060830186612ccf565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261394a5761394a613925565b500490565b60008261395e5761395e613925565b500690565b60006020828403121561397557600080fd5b81516001600160401b0381111561398b57600080fd5b6123fe8482850161361d565b6000602082840312156139a957600080fd5b8151612930816128fe565b600080604083850312156139c757600080fd5b82516139d2816128fe565b60208401519092506001600160401b03808211156139ef57600080fd5b9084019081860360a0811215613a0457600080fd5b613a0c61294d565b6080821215613a1a57600080fd5b613a226129b9565b6040831215613a3057600080fd5b613a3861294d565b92508451613a45816128fe565b80845250602085015160208401528281526040850151602082015260608501516040820152808252506080840151915082821115613a8257600080fd5b613a8e888386016137aa565b6020820152809450505050509250929050565b6000610100613ac483885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613af8608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613b1981840185612ccf565b979650505050505050565b600060208284031215613b3657600080fd5b81516001600160401b0380821115613b4d57600080fd5b9083019060c08286031215613b6157600080fd5b613b696129db565b825181526020830151613b7b816128fe565b60208201526040830151613b8e816128fe565b6040820152606083015182811115613ba557600080fd5b613bb1878286016137ef565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b600060208284031215613be957600080fd5b81516001600160401b0380821115613c0057600080fd5b9083019060c08286031215613c1457600080fd5b613c1c6129db565b8251815260208301516020820152604083015182811115613c3c57600080fd5b613c48878286016137aa565b604083015250606083015182811115613c6057600080fd5b613c6c878286016137ef565b606083015250613c7e608084016134c9565b6080820152613c8f60a084016134c9565b60a082015295945050505050565b60008251613caf818460208701612cab565b9190910192915050565b808202811582820484141761094c5761094c6131bf565b6020815260006109496020830184612ccf56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e54d4f5d1215084dfd06cbe16897419283743e107aae5cef8af599b3032c82c064736f6c63430008130033"; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/types.d.ts b/dist/strategies/DonationVotingMerkleDistributionStrategy/types.d.ts index 9ba155c..6276b7c 100644 --- a/dist/strategies/DonationVotingMerkleDistributionStrategy/types.d.ts +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/types.d.ts @@ -8,22 +8,40 @@ export type Recipient = { recipientAddress: `0x${string}`; metadata: Metadata; }; +export type RegisterDataDonationVoting = { + registryAnchor: `0x${string}`; + recipientAddress: `0x${string}`; + metadata: Metadata; +}; export type Distribution = { index: number; recipientId: string; amount: string; merkleProof: string[]; }; -export type InitializeData = { +export type InitializeParamsDonationVoting = { useRegistryAnchor: boolean; metadataRequired: boolean; - registrationStartTime: number; - registrationEndTime: number; - allocationStartTime: number; - allocationEndTime: number; - allowedTokens: string[]; + registrationStartTime: bigint; + registrationEndTime: bigint; + allocationStartTime: bigint; + allocationEndTime: bigint; + allowedTokens: `0x${string}`[]; +}; +export type TokenPermissions = { + token: `0x${string}`; + amount: bigint; +}; +export type PermitTransferFrom = { + permitted: TokenPermissions; + nonce: bigint; + deadline: bigint; }; export type Permit2Data = { - permit: any; - signature: string; + permit: PermitTransferFrom; + signature: `0x${string}`; +}; +export declare const StrategyTypeDonationVoting: { + Vault: string; + Direct: string; }; diff --git a/dist/strategies/DonationVotingMerkleDistributionStrategy/types.js b/dist/strategies/DonationVotingMerkleDistributionStrategy/types.js index c8ad2e5..fe05149 100644 --- a/dist/strategies/DonationVotingMerkleDistributionStrategy/types.js +++ b/dist/strategies/DonationVotingMerkleDistributionStrategy/types.js @@ -1,2 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.StrategyTypeDonationVoting = void 0; +exports.StrategyTypeDonationVoting = { + Vault: "DonationVotingMerkleDistributionVaultv1", + Direct: "DonationVotingMerkleDistributionDirectTransferv1", +}; diff --git a/package.json b/package.json index 2b203f1..2561c7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@allo-team/allo-v2-sdk", - "version": "1.0.34", + "version": "1.0.35", "description": "sdk for allo v2", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/__tests__/Allo/Allo.test.ts b/src/__tests__ignore/Allo/Allo.test.ts similarity index 100% rename from src/__tests__/Allo/Allo.test.ts rename to src/__tests__ignore/Allo/Allo.test.ts diff --git a/src/__tests__/Registry/Registry.test.ts b/src/__tests__ignore/Registry/Registry.test.ts similarity index 100% rename from src/__tests__/Registry/Registry.test.ts rename to src/__tests__ignore/Registry/Registry.test.ts diff --git a/src/__tests__/Strategy/DonationVoting.test.ts b/src/__tests__ignore/Strategy/DonationVoting.test.ts similarity index 100% rename from src/__tests__/Strategy/DonationVoting.test.ts rename to src/__tests__ignore/Strategy/DonationVoting.test.ts diff --git a/src/__tests__/Strategy/MicroGrants.test.ts b/src/__tests__ignore/Strategy/MicroGrants.test.ts similarity index 100% rename from src/__tests__/Strategy/MicroGrants.test.ts rename to src/__tests__ignore/Strategy/MicroGrants.test.ts diff --git a/src/__tests__/utils/utils.ts b/src/__tests__ignore/utils/utils.ts similarity index 100% rename from src/__tests__/utils/utils.ts rename to src/__tests__ignore/utils/utils.ts diff --git a/src/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.ts b/src/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.ts index 6c42c7a..223acc3 100644 --- a/src/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.ts +++ b/src/strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution.ts @@ -2,101 +2,212 @@ import { Chain, PublicClient, Transport, + encodeAbiParameters, encodeFunctionData, extractChain, getContract, + parseAbiParameters, } from "viem"; import { create } from "../../Client/Client"; -import { abi } from "./donationVoting.config"; import { Allo } from "../../Allo/Allo"; -import { ConstructorArgs, Metadata, TransactionData } from "../../Common/types"; +import { + ConstructorArgs, + DeployParams, + Metadata, + TransactionData, +} from "../../Common/types"; import { PayoutSummary, Status } from "../types"; -import { Recipient } from "./types"; +import { + Distribution, + InitializeParamsDonationVoting, + Permit2Data, + Recipient, + RegisterDataDonationVoting, + StrategyTypeDonationVoting, +} from "./types"; import { supportedChains } from "../../chains.config"; +import { + abi as vaultAbi, + bytecode as vaultBytecode, +} from "./donationVotingVault.config"; +import { + abi as directAbi, + bytecode as directBytecode, +} from "./donationVotingDirect.config"; +import { abi as alloAbi } from "../../Allo/allo.config"; export class DonationVotingMerkleDistributionStrategy { private client: PublicClient; private contract: any; - private strategy: `0x${string}`; + private strategy: `0x${string}` | undefined; private poolId: number; private allo: Allo; - constructor({ chain, rpc, address }: ConstructorArgs) { - const usedChain = extractChain({ - chains: supportedChains, - id: chain as any, - }); - - this.client = create(usedChain, rpc); + constructor({ chain, rpc, address, poolId }: ConstructorArgs) { + const usedChain = extractChain({ + chains: supportedChains, + id: chain as any, + }); - if (!address) - throw new Error( - "DonationVotingMerkleDistributionStrategy: No strategy address provided" - ); - this.strategy = address; + this.client = create(usedChain, rpc); this.allo = new Allo({ chain, rpc }); // to call allocate + if (address) { + this.strategy = address; + + this.contract = getContract({ + address: address, + abi: vaultAbi, + publicClient: this.client, + }); + } + this.poolId = poolId || -1; + } + + public async setPoolId(poolId: number): Promise { + this.poolId = poolId; + const strategyAddress = await this.allo.getStrategy(poolId); + this.setContract(strategyAddress as `0x${string}`); + } + + public setContract(address: `0x${string}`): void { this.contract = getContract({ address: address, - abi: abi, + abi: vaultAbi, publicClient: this.client, }); - this.poolId = 0; // TODO: set poolId + this.strategy = address; + } + + private checkPoolId(): void { + if (this.poolId === -1) + throw new Error( + "DonationVotingMerkleDistributionStrategy: No poolId provided. Please call `setPoolId` first.", + ); + } + + private checkStrategy(): void { + if (!this.strategy) + throw new Error( + "DonationVotingMerkleDistributionStrategy: No strategy address provided. Please call `setContract` first.", + ); + } + + // Init and Deploy + + public async getInitializeData( + params: InitializeParamsDonationVoting, + ): Promise<`0x${string}`> { + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters( + "bool, bool, uint64, uint64, uint64, uint64, address[]", + ), + [ + params.useRegistryAnchor, + params.metadataRequired, + params.registrationStartTime, + params.registrationEndTime, + params.allocationStartTime, + params.allocationEndTime, + params.allowedTokens, + ], + ); + + return encoded; + } + + public getDeployParams(strategyType: string): DeployParams { + const constructorArgs: `0x${string}` = encodeAbiParameters( + parseAbiParameters("address, string"), + [this.allo.address(), strategyType], + ); + const constructorArgsNo0x = constructorArgs.slice(2); + + // create the proper bytecode + const bytecode = + strategyType === StrategyTypeDonationVoting.Vault + ? vaultBytecode + : directBytecode; + const abi = + strategyType === StrategyTypeDonationVoting.Vault ? vaultAbi : directAbi; + + return { + abi: abi, + bytecode: (bytecode + constructorArgsNo0x) as unknown as `0x${string}`, + }; } + // Read only functions public async getNative(): Promise { + this.checkStrategy(); const native = await this.contract.read.NATIVE(); return native; } public async getPermit2(): Promise { + this.checkStrategy(); + const permit2 = await this.contract.read.PERMIT2(); return permit2; } public async getAllocationEndTime(): Promise { + this.checkStrategy(); + const endTime = await this.contract.read.allocationEndTime(); return endTime; } public async getAllocationStartTime(): Promise { + this.checkStrategy(); + const startTime = await this.contract.read.allocationStartTime(); return startTime; } - public async isAllowedTokens(token: string): Promise { + public async getIsAllowedToken(token: string): Promise { + this.checkStrategy(); + const allowed = await this.contract.read.allowedTokens(token); return allowed; } - public async getClaims(recipient: string, token: string): Promise { + public async getClaim(recipient: string, token: string): Promise { + this.checkStrategy(); + const claims = await this.contract.read.claims([recipient, token]); return claims; } public async getDistributionMetadata(): Promise { + this.checkStrategy(); + const metadata: Metadata = await this.contract.read.distributionMetadata(); return metadata; } public async getDistributionStarted(): Promise { + this.checkStrategy(); + const started = await this.contract.read.distributionStarted(); return started; } public async getAllo(): Promise { + this.checkStrategy(); + const allo = await this.contract.read.getAllo(); return allo; @@ -104,8 +215,10 @@ export class DonationVotingMerkleDistributionStrategy { public async getPayouts( recipientIds: string[], - data: string[] + data: string[], ): Promise { + this.checkStrategy(); + const payouts = await this.contract.read.getPayouts([recipientIds, data]); const payoutSummary: PayoutSummary[] = payouts.map((payout: any) => { @@ -119,72 +232,98 @@ export class DonationVotingMerkleDistributionStrategy { } public async getPoolAmount(): Promise { + this.checkStrategy(); + const amount = await this.contract.read.getPoolAmount(); return amount; } public async getPoolId(): Promise { + this.checkStrategy(); + const id = await this.contract.read.getPoolId(); return id; } public async getRecipient(recipientId: string): Promise { + this.checkStrategy(); + const recipient = await this.contract.read.getRecipient([recipientId]); return recipient; } public async getRecipientStatus(recipientId: string): Promise { + this.checkStrategy(); + const status = await this.contract.read.getRecipientStatus([recipientId]); return status; } public async getStrategyId(): Promise { + this.checkStrategy(); + const id = await this.contract.read.getStrategyId(); return id; } - public async hasBeenDistributed(index: number): Promise { + public async getHasBeenDistributed(index: number): Promise { + this.checkStrategy(); + const distributed = await this.contract.read.hasBeenDistributed([index]); return distributed; } - public async isDistributionSet(): Promise { + public async getIsDistributionSet(): Promise { + this.checkStrategy(); + const set = await this.contract.read.isDistributionSet(); return set; } - public async isPoolActive(): Promise { + public async getIsPoolActive(): Promise { + this.checkStrategy(); + const active = await this.contract.read.isPoolActive(); return active; } - public async isValidAllocator(allocator: `0x${string}`): Promise { + public async getIsValidAllocator(allocator: `0x${string}`): Promise { + this.checkStrategy(); + const valid = await this.contract.read.isValidAllocator([allocator]); return valid; } public async getMerkleRoot(): Promise { + this.checkStrategy(); + const root = await this.contract.read.merkleRoot(); return root; } - public async metadataRequired(): Promise { + public async getMetadataRequired(): Promise { + this.checkStrategy(); + const required = await this.contract.read.metadataRequired(); return required; } - public async recipientToStatusIndexes(recipient: string): Promise { + public async getRecipientToStatusIndexes( + recipient: string, + ): Promise { + this.checkStrategy(); + const indexes = await this.contract.read.recipientToStatusIndexes([ recipient, ]); @@ -192,112 +331,253 @@ export class DonationVotingMerkleDistributionStrategy { return indexes; } - public async recipientsCounter(): Promise { + public async getRecipientsCounter(): Promise { + this.checkStrategy(); + const counter = await this.contract.read.recipientsCounter(); return counter; } - public async registrationEndTime(): Promise { + public async getRegistrationEndTime(): Promise { + this.checkStrategy(); + const endTime = await this.contract.read.registrationEndTime(); return endTime; } - public async registrationStartTime(): Promise { + public async getRegistrationStartTime(): Promise { + this.checkStrategy(); + const startTime = await this.contract.read.registrationStartTime(); return startTime; } - public async statusesBitMap(index: number): Promise { + public async getStatusAtIndex(index: number): Promise { + this.checkStrategy(); + const bitMap = await this.contract.read.statusesBitMap([index]); return bitMap; } - public async totalPayoutAmount(): Promise { + public async getTotalPayoutAmount(): Promise { + this.checkStrategy(); + const amount = await this.contract.read.totalPayoutAmount(); return amount; } public async useRegistryAnchor(): Promise { + this.checkStrategy(); + const anchor = await this.contract.read.useRegistryAnchor(); return anchor; } // Callable by allo client - public allocate(strategyData: string): TransactionData { - return this.allo.allocate(this.poolId, strategyData); - } + public getAllocationData( + data: Permit2Data, + ethAmount?: bigint, + ): TransactionData { + this.checkPoolId(); + + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters("((address, uint256), uint256, uint256), bytes32"), + [ + [ + [data.permit.permitted.token, data.permit.permitted.amount], + data.permit.nonce, + data.permit.deadline, + ], + data.signature, + ], + ); - public batchAllocate(strategyData: string[]): TransactionData { - const poolIds = Array(strategyData.length).fill(this.poolId); + const encodedData = encodeFunctionData({ + abi: alloAbi, + functionName: "allocate", + args: [this.poolId, encoded], + }); - return this.allo.batchAllocate(poolIds, strategyData); + return { + to: this.allo.address(), + data: encodedData, + value: ethAmount ? ethAmount.toString() : "0", + }; } - public registerRecipient(strategyData: string): TransactionData { - return this.allo.registerRecipient(this.poolId, strategyData); + public getBatchAllocationData( + data: Permit2Data[], + ethAmount?: bigint, + ): TransactionData { + this.checkPoolId(); + + const encodedParams: `0x${string}`[] = []; + + data.forEach((allocation) => { + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters("((address, uint256), uint256, uint256), bytes32"), + [ + [ + [ + allocation.permit.permitted.token, + allocation.permit.permitted.amount, + ], + allocation.permit.nonce, + allocation.permit.deadline, + ], + allocation.signature, + ], + ); + + encodedParams.push(encoded); + }); + + const poolIds: bigint[] = Array(encodedParams.length).fill(this.poolId); + + const encodedData = encodeFunctionData({ + abi: alloAbi, + functionName: "batchAllocate", + args: [poolIds, encodedParams], + }); + + return { + to: this.allo.address(), + data: encodedData, + value: ethAmount ? ethAmount.toString() : "0", + }; } - public batchRegisterRecipient(strategyData: string[]): TransactionData { - const poolIds = Array(strategyData.length).fill(this.poolId); + public getRegisterRecipientData( + data: RegisterDataDonationVoting, + ): TransactionData { + this.checkPoolId(); + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters("address, address, (uint256, string)"), + [ + data.registryAnchor, + data.recipientAddress, + [data.metadata.protocol, data.metadata.pointer], + ], + ); - return this.allo.batchRegisterRecipient(poolIds, strategyData); + const encodedData = encodeFunctionData({ + abi: alloAbi, + functionName: "registerRecipient", + args: [this.poolId, encoded], + }); + + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } - public fundPool(amount: number): TransactionData { - return this.allo.fundPool(this.poolId, amount); + public getBatchRegisterRecipientData( + data: RegisterDataDonationVoting[], + ): TransactionData { + this.checkPoolId(); + const encodedParams: `0x${string}`[] = []; + + data.forEach((registerData) => { + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters("address, address, (uint256, string)"), + [ + registerData.registryAnchor, + registerData.recipientAddress, + [registerData.metadata.protocol, registerData.metadata.pointer], + ], + ); + + encodedParams.push(encoded); + }); + + const poolIds: bigint[] = Array(encodedParams.length).fill(this.poolId); + + const encodedData = encodeFunctionData({ + abi: alloAbi, + functionName: "batchRegisterRecipient", + args: [poolIds, encodedParams], + }); + + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } - public distribute(recipientIds: string[], data: string): TransactionData { - return this.allo.distribute(this.poolId, recipientIds, data); + public distribute(data: Distribution[]): TransactionData { + this.checkPoolId(); + + const encoded: `0x${string}` = encodeAbiParameters( + parseAbiParameters("(uint256, address, uint256, bytes32[])[]]"), + [[data.map((d) => [d.index, d.recipientId, d.amount, d.merkleProof])]], + ); + + const encodedData = encodeFunctionData({ + abi: alloAbi, + functionName: "distribute", + args: [this.poolId, [], encoded], + }); + + return { + to: this.allo.address(), + data: encodedData, + value: "0", + }; } // Write functions public claim( - claims: { recipientId: string; token: string }[] + claims: { recipientId: string; token: string }[], ): TransactionData { + this.checkStrategy(); const data = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "claim", args: [claims], }); return { - to: this.strategy, + to: this.strategy!, data: data, value: "0", }; } public multicall(data: string[]): TransactionData { + this.checkStrategy(); const encodedData = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "multicall", args: [data], }); return { - to: this.strategy, + to: this.strategy!, data: encodedData, value: "0", }; } public reviewRecipients( - statuses: { index: number; statusRow: number }[] + statuses: { index: number; statusRow: number }[], ): TransactionData { + this.checkStrategy(); const data = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "reviewRecipients", args: [statuses], }); return { - to: this.strategy, + to: this.strategy!, data: data, value: "0", }; @@ -305,16 +585,18 @@ export class DonationVotingMerkleDistributionStrategy { public updateDistribution( merkleRoot: string, - distributionMetadata: Metadata + distributionMetadata: Metadata, ): TransactionData { + this.checkStrategy(); + const data = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "updateDistribution", args: [merkleRoot, distributionMetadata], }); return { - to: this.strategy, + to: this.strategy!, data: data, value: "0", }; @@ -324,10 +606,12 @@ export class DonationVotingMerkleDistributionStrategy { registrationStartTime: number, registrationEndTime: number, allocationStartTime: number, - allocationEndTime: number + allocationEndTime: number, ): TransactionData { + this.checkStrategy(); + const data = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "updatePoolTimestamps", args: [ registrationStartTime, @@ -338,21 +622,23 @@ export class DonationVotingMerkleDistributionStrategy { }); return { - to: this.strategy, + to: this.strategy!, data: data, value: "0", }; } public withdraw(amount: number): TransactionData { + this.checkStrategy(); + const data = encodeFunctionData({ - abi: abi, + abi: vaultAbi, functionName: "withdraw", args: [amount], }); return { - to: this.strategy, + to: this.strategy!, data: data, value: "0", }; diff --git a/src/strategies/DonationVotingMerkleDistributionStrategy/donationVoting.config.ts b/src/strategies/DonationVotingMerkleDistributionStrategy/donationVoting.config.ts deleted file mode 100644 index 52f258a..0000000 --- a/src/strategies/DonationVotingMerkleDistributionStrategy/donationVoting.config.ts +++ /dev/null @@ -1,1225 +0,0 @@ -// uses Vault abi, since it's the same like direct transfer + an additional claim function -export const abi = [ - { - inputs: [ - { - internalType: "address", - name: "_allo", - type: "address", - }, - { - internalType: "string", - name: "_name", - type: "string", - }, - { - internalType: "contract ISignatureTransfer", - name: "_permit2", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "ALLOCATION_ACTIVE", - type: "error", - }, - { - inputs: [], - name: "ALLOCATION_NOT_ACTIVE", - type: "error", - }, - { - inputs: [], - name: "ALLOCATION_NOT_ENDED", - type: "error", - }, - { - inputs: [], - name: "ALREADY_INITIALIZED", - type: "error", - }, - { - inputs: [], - name: "AMOUNT_MISMATCH", - type: "error", - }, - { - inputs: [], - name: "ANCHOR_ERROR", - type: "error", - }, - { - inputs: [], - name: "ARRAY_MISMATCH", - type: "error", - }, - { - inputs: [], - name: "INVALID", - type: "error", - }, - { - inputs: [], - name: "INVALID_ADDRESS", - type: "error", - }, - { - inputs: [], - name: "INVALID_FEE", - type: "error", - }, - { - inputs: [], - name: "INVALID_METADATA", - type: "error", - }, - { - inputs: [], - name: "INVALID_REGISTRATION", - type: "error", - }, - { - inputs: [], - name: "IS_APPROVED_STRATEGY", - type: "error", - }, - { - inputs: [], - name: "MISMATCH", - type: "error", - }, - { - inputs: [], - name: "NONCE_NOT_AVAILABLE", - type: "error", - }, - { - inputs: [], - name: "NOT_APPROVED_STRATEGY", - type: "error", - }, - { - inputs: [], - name: "NOT_ENOUGH_FUNDS", - type: "error", - }, - { - inputs: [], - name: "NOT_INITIALIZED", - type: "error", - }, - { - inputs: [], - name: "NOT_PENDING_OWNER", - type: "error", - }, - { - inputs: [], - name: "POOL_ACTIVE", - type: "error", - }, - { - inputs: [], - name: "POOL_INACTIVE", - type: "error", - }, - { - inputs: [], - name: "RECIPIENT_ALREADY_ACCEPTED", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "recipientId", - type: "address", - }, - ], - name: "RECIPIENT_ERROR", - type: "error", - }, - { - inputs: [], - name: "RECIPIENT_NOT_ACCEPTED", - type: "error", - }, - { - inputs: [], - name: "REGISTRATION_NOT_ACTIVE", - type: "error", - }, - { - inputs: [], - name: "UNAUTHORIZED", - type: "error", - }, - { - inputs: [], - name: "ZERO_ADDRESS", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "Allocated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "BatchPayoutSuccessful", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "recipientAddress", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "Claimed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "recipientAddress", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "Distributed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "merkleRoot", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "protocol", - type: "uint256", - }, - { - internalType: "string", - name: "pointer", - type: "string", - }, - ], - indexed: false, - internalType: "struct Metadata", - name: "metadata", - type: "tuple", - }, - ], - name: "DistributionUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "grantee", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "token", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - ], - name: "FundsDistributed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint8", - name: "version", - type: "uint8", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "allo", - type: "address", - }, - { - indexed: false, - internalType: "bytes32", - name: "profileId", - type: "bytes32", - }, - { - indexed: false, - internalType: "uint256", - name: "poolId", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bool", - name: "active", - type: "bool", - }, - ], - name: "PoolActive", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "rowIndex", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "fullRow", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "RecipientStatusUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "Registered", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "registrationStartTime", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "registrationEndTime", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "allocationStartTime", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "allocationEndTime", - type: "uint64", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "TimestampsUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipientId", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - { - indexed: false, - internalType: "uint8", - name: "status", - type: "uint8", - }, - ], - name: "UpdatedRegistration", - type: "event", - }, - { - inputs: [], - name: "NATIVE", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "PERMIT2", - outputs: [ - { - internalType: "contract ISignatureTransfer", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - { - internalType: "address", - name: "_sender", - type: "address", - }, - ], - name: "allocate", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "allocationEndTime", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "allocationStartTime", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "allowedTokens", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "recipientId", - type: "address", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - ], - internalType: - "struct DonationVotingMerkleDistributionVaultStrategy.Claim[]", - name: "_claims", - type: "tuple[]", - }, - ], - name: "claim", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "claims", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "_recipientIds", - type: "address[]", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - { - internalType: "address", - name: "_sender", - type: "address", - }, - ], - name: "distribute", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "distributionMetadata", - outputs: [ - { - internalType: "uint256", - name: "protocol", - type: "uint256", - }, - { - internalType: "string", - name: "pointer", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "distributionStarted", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAllo", - outputs: [ - { - internalType: "contract IAllo", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "_recipientIds", - type: "address[]", - }, - { - internalType: "bytes[]", - name: "_data", - type: "bytes[]", - }, - ], - name: "getPayouts", - outputs: [ - { - components: [ - { - internalType: "address", - name: "recipientAddress", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - internalType: "struct IStrategy.PayoutSummary[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getPoolAmount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getPoolId", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_recipientId", - type: "address", - }, - ], - name: "getRecipient", - outputs: [ - { - components: [ - { - internalType: "bool", - name: "useRegistryAnchor", - type: "bool", - }, - { - internalType: "address", - name: "recipientAddress", - type: "address", - }, - { - components: [ - { - internalType: "uint256", - name: "protocol", - type: "uint256", - }, - { - internalType: "string", - name: "pointer", - type: "string", - }, - ], - internalType: "struct Metadata", - name: "metadata", - type: "tuple", - }, - ], - internalType: - "struct DonationVotingMerkleDistributionBaseStrategy.Recipient", - name: "recipient", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_recipientId", - type: "address", - }, - ], - name: "getRecipientStatus", - outputs: [ - { - internalType: "enum IStrategy.Status", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getStrategyId", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_index", - type: "uint256", - }, - ], - name: "hasBeenDistributed", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_amount", - type: "uint256", - }, - ], - name: "increasePoolAmount", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_poolId", - type: "uint256", - }, - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "isDistributionSet", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "isPoolActive", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_allocator", - type: "address", - }, - ], - name: "isValidAllocator", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "merkleRoot", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "metadataRequired", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes[]", - name: "data", - type: "bytes[]", - }, - ], - name: "multicall", - outputs: [ - { - internalType: "bytes[]", - name: "results", - type: "bytes[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "recipientToStatusIndexes", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "recipientsCounter", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "_data", - type: "bytes", - }, - { - internalType: "address", - name: "_sender", - type: "address", - }, - ], - name: "registerRecipient", - outputs: [ - { - internalType: "address", - name: "recipientId", - type: "address", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "registrationEndTime", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "registrationStartTime", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - { - internalType: "uint256", - name: "statusRow", - type: "uint256", - }, - ], - internalType: - "struct DonationVotingMerkleDistributionBaseStrategy.ApplicationStatus[]", - name: "statuses", - type: "tuple[]", - }, - ], - name: "reviewRecipients", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "statusesBitMap", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalPayoutAmount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_merkleRoot", - type: "bytes32", - }, - { - components: [ - { - internalType: "uint256", - name: "protocol", - type: "uint256", - }, - { - internalType: "string", - name: "pointer", - type: "string", - }, - ], - internalType: "struct Metadata", - name: "_distributionMetadata", - type: "tuple", - }, - ], - name: "updateDistribution", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "_registrationStartTime", - type: "uint64", - }, - { - internalType: "uint64", - name: "_registrationEndTime", - type: "uint64", - }, - { - internalType: "uint64", - name: "_allocationStartTime", - type: "uint64", - }, - { - internalType: "uint64", - name: "_allocationEndTime", - type: "uint64", - }, - ], - name: "updatePoolTimestamps", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "useRegistryAnchor", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_amount", - type: "uint256", - }, - ], - name: "withdraw", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -]; diff --git a/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.ts b/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.ts new file mode 100644 index 0000000..43335de --- /dev/null +++ b/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingDirect.config.ts @@ -0,0 +1,1137 @@ +// uses Vault abi, since it's the same like direct transfer + an additional claim function +export const abi = [ + { + inputs: [ + { + internalType: "address", + name: "_allo", + type: "address", + }, + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "contract ISignatureTransfer", + name: "_permit2", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ALLOCATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ENDED", + type: "error", + }, + { + inputs: [], + name: "ALREADY_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "AMOUNT_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "ANCHOR_ERROR", + type: "error", + }, + { + inputs: [], + name: "ARRAY_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "INVALID", + type: "error", + }, + { + inputs: [], + name: "INVALID_ADDRESS", + type: "error", + }, + { + inputs: [], + name: "INVALID_FEE", + type: "error", + }, + { + inputs: [], + name: "INVALID_METADATA", + type: "error", + }, + { + inputs: [], + name: "INVALID_REGISTRATION", + type: "error", + }, + { + inputs: [], + name: "IS_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "MISMATCH", + type: "error", + }, + { + inputs: [], + name: "NONCE_NOT_AVAILABLE", + type: "error", + }, + { + inputs: [], + name: "NOT_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "NOT_ENOUGH_FUNDS", + type: "error", + }, + { + inputs: [], + name: "NOT_IMPLEMENTED", + type: "error", + }, + { + inputs: [], + name: "NOT_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "NOT_PENDING_OWNER", + type: "error", + }, + { + inputs: [], + name: "POOL_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "POOL_INACTIVE", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_ALREADY_ACCEPTED", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "RECIPIENT_ERROR", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_NOT_ACCEPTED", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "UNAUTHORIZED", + type: "error", + }, + { + inputs: [], + name: "ZERO_ADDRESS", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Allocated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "BatchPayoutSuccessful", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Distributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + name: "DistributionUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "grantee", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "FundsDistributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "poolId", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool", + }, + ], + name: "PoolActive", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "rowIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fullRow", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RecipientStatusUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Registered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "registrationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "registrationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "TimestampsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint8", + name: "status", + type: "uint8", + }, + ], + name: "UpdatedRegistration", + type: "event", + }, + { + inputs: [], + name: "NATIVE", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT2", + outputs: [ + { + internalType: "contract ISignatureTransfer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "allocate", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "allocationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allocationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "distribute", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributionMetadata", + outputs: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "distributionStarted", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAllo", + outputs: [ + { + internalType: "contract IAllo", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "_data", + type: "bytes[]", + }, + ], + name: "getPayouts", + outputs: [ + { + components: [ + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + internalType: "struct IStrategy.PayoutSummary[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipient", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "useRegistryAnchor", + type: "bool", + }, + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + internalType: + "struct DonationVotingMerkleDistributionBaseStrategy.Recipient", + name: "recipient", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipientStatus", + outputs: [ + { + internalType: "enum IStrategy.Status", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getStrategyId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_index", + type: "uint256", + }, + ], + name: "hasBeenDistributed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "increasePoolAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_poolId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isDistributionSet", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isPoolActive", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_allocator", + type: "address", + }, + ], + name: "isValidAllocator", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "merkleRoot", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "metadataRequired", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "recipientToStatusIndexes", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "recipientsCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "registerRecipient", + outputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "registrationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "registrationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "statusRow", + type: "uint256", + }, + ], + internalType: + "struct DonationVotingMerkleDistributionBaseStrategy.ApplicationStatus[]", + name: "statuses", + type: "tuple[]", + }, + { + internalType: "uint256", + name: "refRecipientsCounter", + type: "uint256", + }, + ], + name: "reviewRecipients", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "statusesBitMap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalPayoutAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "_distributionMetadata", + type: "tuple", + }, + ], + name: "updateDistribution", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "_registrationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_registrationEndTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationEndTime", + type: "uint64", + }, + ], + name: "updatePoolTimestamps", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useRegistryAnchor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +]; + +export const bytecode = + "0x60e060405260016008553480156200001657600080fd5b5060405162003b1c38038062003b1c833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c05161388b62000291600039600081816104d40152611cac0152600061038701526000818161029b01528181610e2c01528181610f95015281816117800152611db5015261388b6000f3fe60806040526004361061021e5760003560e01c80636afdd85011610123578063df868ed3116100ab578063edd146cc1161006f578063edd146cc146106ca578063ef2920fc146106ea578063f31db3d1146106fd578063f5b0dfb71461071d578063f6f258911461073d57600080fd5b8063df868ed31461061b578063dff7d2c714610630578063e744092e14610657578063e7efcfc214610687578063eb11af931461069d57600080fd5b8063a0cf0aea116100f2578063a0cf0aea14610553578063ac9650d81461057b578063b2b878d0146105a8578063cb0e85a6146105d5578063d2e17f59146105f457600080fd5b80636afdd850146104c257806373af3453146104f657806395355b3b146105165780639af5c09d1461052c57600080fd5b806342fda9c7116101a657806351cff8d91161017557806351cff8d914610418578063570897391461043857806359a3977b146104525780635f1b55f31461047557806362812a391461049557600080fd5b806342fda9c7146103785780634533d678146103ab5780634ab4ba42146103e35780634d31d087146103f857600080fd5b806321755088116101ed57806321755088146102f35780632bbe0cae146103235780632d52eff2146103365780632eb4a7ab1461034d57806338fff2d01461036357600080fd5b806301fc1c641461022a5780630a6f0ee91461026a57806315cc481e1461028c5780632143e92f146102d357600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061025761024536600461252f565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561027657600080fd5b5061028a610285366004612760565b61076a565b005b34801561029857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610261565b3480156102df57600080fd5b5061028a6102ee3660046127ec565b61078a565b3480156102ff57600080fd5b506005546103139062010000900460ff1681565b6040519015158152602001610261565b6102bb610331366004612848565b610887565b34801561034257600080fd5b50600a541515610313565b34801561035957600080fd5b50610257600a5481565b34801561036f57600080fd5b50600154610257565b34801561038457600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610257565b3480156103b757600080fd5b506006546103cb906001600160401b031681565b6040516001600160401b039091168152602001610261565b3480156103ef57600080fd5b50600254610257565b34801561040457600080fd5b5061031361041336600461252f565b6108ac565b34801561042457600080fd5b5061028a61043336600461252f565b6108b5565b34801561044457600080fd5b506005546103139060ff1681565b34801561045e57600080fd5b5061046761092f565b6040516102619291906128e9565b34801561048157600080fd5b50610313610490366004612902565b6109c6565b3480156104a157600080fd5b506104b56104b036600461252f565b6109d1565b604051610261919061291b565b3480156104ce57600080fd5b506102bb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561050257600080fd5b5061028a61051136600461296a565b6109e2565b34801561052257600080fd5b5061025760085481565b34801561053857600080fd5b506005546103cb90630100000090046001600160401b031681565b34801561055f57600080fd5b506102bb73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561058757600080fd5b5061059b610596366004612a03565b610a84565b6040516102619190612a77565b3480156105b457600080fd5b506105c86105c3366004612ad9565b610b78565b6040516102619190612bad565b3480156105e157600080fd5b5060055461031390610100900460ff1681565b34801561060057600080fd5b506005546103cb90600160981b90046001600160401b031681565b34801561062757600080fd5b50610313610c76565b34801561063c57600080fd5b506005546103cb90600160581b90046001600160401b031681565b34801561066357600080fd5b5061031361067236600461252f565b600e6020526000908152604090205460ff1681565b34801561069357600080fd5b5061025760075481565b3480156106a957600080fd5b506106bd6106b836600461252f565b610c85565b6040516102619190612c23565b3480156106d657600080fd5b5061028a6106e5366004612c4b565b610c90565b61028a6106f8366004612848565b610ceb565b34801561070957600080fd5b5061028a610718366004612c91565b610d13565b34801561072957600080fd5b5061028a610738366004612902565b610df7565b34801561074957600080fd5b50610257610758366004612902565b600b6020526000908152604090205481565b610772610e21565b61077a610e6c565b610785838383610e8f565b505050565b3361079481610f6b565b6107a08585858561101d565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610891610e21565b610899610e6c565b6108a383836110b7565b90505b92915050565b600060016108a6565b336108bf81610f6b565b6006546108d8906001600160401b031662278d00612d61565b6001600160401b0316421161090057604051637fcce2a960e01b815260040160405180910390fd5b600061090c8330611409565b905060008061091b8284612d81565b9050610928853383611452565b5050505050565b600380546004805491929161094390612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461096f90612d94565b80156109bc5780601f10610991576101008083540402835291602001916109bc565b820191906000526020600020905b81548152906001019060200180831161099f57829003601f168201915b5050505050905082565b60006108a68261148c565b6109d96124d4565b6108a6826114cd565b6109ea6115c6565b336109f481610f6b565b60055462010000900460ff1615610a1e57604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610a3f9082612e14565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610a77929190612ed3565b60405180910390a1505050565b6060816001600160401b03811115610a9e57610a9e612553565b604051908082528060200260200182016040528015610ad157816020015b6060815260200190600190039081610abc5790505b50905060005b82811015610b7157610b4130858584818110610af557610af5612f78565b9050602002810190610b079190612f8e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115f192505050565b828281518110610b5357610b53612f78565b60200260200101819052508080610b6990612fdb565b915050610ad7565b5092915050565b81518151606091908114610b9f57604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610bb957610bb9612553565b604051908082528060200260200182016040528015610bfe57816020015b6040805180820190915260008082526020820152815260200190600190039081610bd75790505b50905060005b82811015610c6d57610c48868281518110610c2157610c21612f78565b6020026020010151868381518110610c3b57610c3b612f78565b6020026020010151611616565b828281518110610c5a57610c5a612f78565b6020908102919091010152600101610c04565b50949350505050565b6000610c806116d1565b905090565b60006108a68261171a565b610c98610e21565b600081806020019051810190610cae9190613083565b9050610cba8382611739565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610a779291906128e9565b610cf3610e21565b610cfb610e6c565b610d0582826119e7565b610d0f8282611bc6565b5050565b610d1b611d21565b33610d2581610f6b565b6008548214610d4757604051637fcce2a960e01b815260040160405180910390fd5b60005b8351811015610df1576000848281518110610d6757610d67612f78565b60200260200101516000015190506000858381518110610d8957610d89612f78565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101610d4a565b50505050565b610dff610e21565b8060026000828254610e119190613155565b90915550610e1e90508181565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e6a5760405163075fd2b160e01b815260040160405180910390fd5b565b600154600003610e6a57604051630f68fe6360e21b815260040160405180910390fd5b80610e9981610f6b565b600a54600003610ebc57604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16610ede576005805462ff00001916620100001790555b600083806020019051810190610ef4919061322a565b805190915060005b81811015610f2e57610f26838281518110610f1957610f19612f78565b6020026020010151611d4c565b600101610efc565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100091906132da565b610e1e5760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b03164211806110455750826001600160401b0316846001600160401b0316115b806110615750816001600160401b0316846001600160401b0316115b8061107d5750806001600160401b0316826001600160401b0316115b806110995750806001600160401b0316836001600160401b0316115b15610df157604051637fcce2a960e01b815260040160405180910390fd5b60006110c1611eda565b60008060006110e3604051806040016040528060008152602001606081525090565b60055460ff16156111355786806020019051810190611102919061338b565b919650935090506111138587611f2a565b6111305760405163075fd2b160e01b815260040160405180910390fd5b6111a0565b86806020019051810190611149919061338b565b6001600160a01b0383161515965090945090925090508361116a578561116c565b815b945083801561118257506111808587611f2a565b155b156111a05760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156111c3575060208101515115806111c357508051155b156111e15760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b0383166112185760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff001990931692909217825582516001830190815590830151839190600284019061127c9082612e14565b505060055460ff1690506112905784611293565b60015b815460ff19169015151781556001600160a01b0386166000908152600c6020526040812054900361136f576008546001600160a01b0387166000908152600c60205260409020556112e98660015b60ff16612022565b6000886008546040516020016113009291906133ee565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a60405161134c929190613410565b60405180910390a26008805490600061136483612fdb565b9190505550506113fe565b600061137a87612055565b905060011960ff821601611398576113938760016112e1565b6113af565b60021960ff8216016113af576113af8760046112e1565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a6113e58b612055565b6040516113f49392919061343b565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161144157506001600160a01b038116316108a6565b61144b8383612096565b90506108a6565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016114815761078582826120cb565b6107858383836120e7565b60008061149b61010084613486565b905060006114ab6101008561349a565b6000928352600d602052604090922054600190921b9182169091149392505050565b6114d56124d4565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161153a90612d94565b80601f016020809104026020016040519081016040528092919081815260200182805461156690612d94565b80156115b35780601f10611588576101008083540402835291602001916115b3565b820191906000526020600020905b81548152906001019060200180831161159657829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b03164211610e6a57604051634543ced160e11b815260040160405180910390fd5b60606108a3838360405180606001604052806027815260200161382f60279139612136565b604080518082019091526000808252602082015260008280602001905181019061164091906134ae565b805160208201516040830151606084015193945091929091906000611664846114cd565b60200151905061167785858386866121ae565b156116a7576040518060400160405280826001600160a01b031681526020018481525096505050505050506108a6565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b6005546000904263010000009091046001600160401b0316118015906117095750600554600160581b90046001600160401b03164211155b156117145750600190565b50600090565b600061172582612055565b60ff1660068111156108a6576108a6612c0d565b61174282612257565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa1580156117cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f391906134e2565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff191691871691821790556118cd95918504821694928304821693909204169061101d565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c08101515160008190036119865760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015610df1576001600e60008560c0015184815181106119ad576119ad612f78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611989565b6119ef6122a6565b60008083806020019051810190611a0691906134ff565b80515160208101519051929450909250906002611a2285612055565b60ff166006811115611a3657611a36612c0d565b6006811115611a4757611a47612c0d565b14611a705760405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6001600160a01b0381166000908152600e602052604090205460ff16158015611ac4575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611ae257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611b0f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611b4157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611b415750813414155b15611b5f57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611bb6939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611bdd91906134ff565b80515180516020909101519294509092509073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601611c655780341015611c35576040516374c5672b60e01b815260040160405180910390fd5b6001600160a01b038085166000908152600f6020526040902054611c609161010090910416826120cb565b611d19565b82516040805180820182526001600160a01b038781166000908152600f60209081529084902054610100900482168352808301869052870151925163187945bd60e11b81527f0000000000000000000000000000000000000000000000000000000000000000909116936330f28b7a93611ce69391928b91906004016135ec565b600060405180830381600087803b158015611d0057600080fd5b505af1158015611d14573d6000803e3d6000fd5b505050505b505050505050565b6006546001600160401b0316421115610e6a5760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f909652929094205492939092909161010090910416611d9385858386866121ae565b15611eb65760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d91611dec9160040190815260200190565b600060405180830381865afa158015611e09573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e31919081019061366f565b9050611e3c866122ee565b8360026000828254611e4e9190612d81565b90915550506040810151611e63908386611452565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a350611d19565b60405163f4a513b960e01b81526001600160a01b038516600482015260240161120f565b6005544263010000009091046001600160401b03161180611f0c5750600554600160581b90046001600160401b031642115b15610e6a57604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa158015611f78573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fa09190810190613722565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa158015611ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201a91906132da565b949350505050565b60008060006120308561232c565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361207c57506000919050565b6000806120888461232c565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610d0f5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d15600160005114171661212c576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b03168560405161215391906137e8565b600060405180830381855af49150503d806000811461218e576040519150601f19603f3d011682016040523d82523d6000602084013e612193565b606091505b50915091506121a48683838761239f565b9695505050505050565b60006121b98661148c565b156121c65750600061224e565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061223a83600a5483612418565b61224857600091505061224e565b60019150505b95945050505050565b61225f610e21565b600154156122805760405163439a74c960e01b815260040160405180910390fd5b806000036122a157604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806122d157506006546001600160401b031642115b15610e6a5760405162b828c960e81b815260040160405180910390fd5b60006122fc61010083613486565b9050600061230c6101008461349a565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061235790600190612d81565b90506000612366604083613486565b9050600061237560408461349a565b612380906004613804565b6000838152600b60205260409020549298909750919550909350505050565b6060831561240e578251600003612407576001600160a01b0385163b6124075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161120f565b508161201a565b61201a838361242e565b6000826124258584612458565b14949350505050565b81511561243e5781518083602001fd5b8060405162461bcd60e51b815260040161120f919061381b565b600081815b845181101561249d576124898286838151811061247c5761247c612f78565b60200260200101516124a5565b91508061249581612fdb565b91505061245d565b509392505050565b60008183106124c15760008281526020849052604090206108a3565b60008381526020839052604090206108a3565b604051806060016040528060001515815260200160006001600160a01b03168152602001612515604051806040016040528060008152602001606081525090565b905290565b6001600160a01b0381168114610e1e57600080fd5b60006020828403121561254157600080fd5b813561254c8161251a565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561258b5761258b612553565b60405290565b60405160e081016001600160401b038111828210171561258b5761258b612553565b604051608081016001600160401b038111828210171561258b5761258b612553565b604051606081016001600160401b038111828210171561258b5761258b612553565b60405160c081016001600160401b038111828210171561258b5761258b612553565b604051601f8201601f191681016001600160401b038111828210171561264157612641612553565b604052919050565b60006001600160401b0382111561266257612662612553565b5060051b60200190565b600082601f83011261267d57600080fd5b8135602061269261268d83612649565b612619565b82815260059290921b840181019181810190868411156126b157600080fd5b8286015b848110156126d55780356126c88161251a565b83529183019183016126b5565b509695505050505050565b60006001600160401b038211156126f9576126f9612553565b50601f01601f191660200190565b600061271561268d846126e0565b905082815283838301111561272957600080fd5b828260208301376000602084830101529392505050565b600082601f83011261275157600080fd5b6108a383833560208501612707565b60008060006060848603121561277557600080fd5b83356001600160401b038082111561278c57600080fd5b6127988783880161266c565b945060208601359150808211156127ae57600080fd5b506127bb86828701612740565b92505060408401356127cc8161251a565b809150509250925092565b6001600160401b0381168114610e1e57600080fd5b6000806000806080858703121561280257600080fd5b843561280d816127d7565b9350602085013561281d816127d7565b9250604085013561282d816127d7565b9150606085013561283d816127d7565b939692955090935050565b6000806040838503121561285b57600080fd5b82356001600160401b0381111561287157600080fd5b61287d85828601612740565b925050602083013561288e8161251a565b809150509250929050565b60005b838110156128b457818101518382015260200161289c565b50506000910152565b600081518084526128d5816020860160208601612899565b601f01601f19169290920160200192915050565b82815260406020820152600061201a60408301846128bd565b60006020828403121561291457600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a084015261201a60c08401826128bd565b6000806040838503121561297d57600080fd5b8235915060208301356001600160401b038082111561299b57600080fd5b90840190604082870312156129af57600080fd5b6129b7612569565b823581526020830135828111156129cd57600080fd5b80840193505086601f8401126129e257600080fd5b6129f187843560208601612707565b60208201528093505050509250929050565b60008060208385031215612a1657600080fd5b82356001600160401b0380821115612a2d57600080fd5b818501915085601f830112612a4157600080fd5b813581811115612a5057600080fd5b8660208260051b8501011115612a6557600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612acc57603f19888603018452612aba8583516128bd565b94509285019290850190600101612a9e565b5092979650505050505050565b60008060408385031215612aec57600080fd5b82356001600160401b0380821115612b0357600080fd5b612b0f8683870161266c565b9350602091508185013581811115612b2657600080fd5b8501601f81018713612b3757600080fd5b8035612b4561268d82612649565b81815260059190911b82018401908481019089831115612b6457600080fd5b8584015b83811015612b9c57803586811115612b805760008081fd5b612b8e8c8983890101612740565b845250918601918601612b68565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612c0057612bf084835180516001600160a01b03168252602090810151910152565b9284019290850190600101612bca565b5091979650505050505050565b634e487b7160e01b600052602160045260246000fd5b6020810160078310612c4557634e487b7160e01b600052602160045260246000fd5b91905290565b60008060408385031215612c5e57600080fd5b8235915060208301356001600160401b03811115612c7b57600080fd5b612c8785828601612740565b9150509250929050565b6000806040808486031215612ca557600080fd5b83356001600160401b03811115612cbb57600080fd5b8401601f81018613612ccc57600080fd5b80356020612cdc61268d83612649565b82815260069290921b83018101918181019089841115612cfb57600080fd5b938201935b83851015612d3b5785858b031215612d185760008081fd5b612d20612569565b85358152838601358482015282529385019390820190612d00565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610b7157610b71612d4b565b818103818111156108a6576108a6612d4b565b600181811c90821680612da857607f821691505b602082108103612dc857634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561078557600081815260208120601f850160051c81016020861015612df55750805b601f850160051c820191505b81811015611d1957828155600101612e01565b81516001600160401b03811115612e2d57612e2d612553565b612e4181612e3b8454612d94565b84612dce565b602080601f831160018114612e765760008415612e5e5750858301515b600019600386901b1c1916600185901b178555611d19565b600085815260208120601f198616915b82811015612ea557888601518255948401946001909101908401612e86565b5085821015612ec35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b828152600060206040818401528354604084015260018085016040606086015260008154612f0081612d94565b80608089015260a085831660008114612f205760018114612f3a57612f68565b60ff1984168a83015282151560051b8a0182019450612f68565b856000528760002060005b84811015612f605781548c8201850152908801908901612f45565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612fa557600080fd5b8301803591506001600160401b03821115612fbf57600080fd5b602001915036819003821315612fd457600080fd5b9250929050565b600060018201612fed57612fed612d4b565b5060010190565b8051801515811461300457600080fd5b919050565b8051613004816127d7565b80516130048161251a565b600082601f83011261303057600080fd5b8151602061304061268d83612649565b82815260059290921b8401810191818101908684111561305f57600080fd5b8286015b848110156126d55780516130768161251a565b8352918301918301613063565b60006020828403121561309557600080fd5b81516001600160401b03808211156130ac57600080fd5b9083019060e082860312156130c057600080fd5b6130c8612591565b6130d183612ff4565b81526130df60208401612ff4565b60208201526130f060408401613009565b604082015261310160608401613009565b606082015261311260808401613009565b608082015261312360a08401613009565b60a082015260c08301518281111561313a57600080fd5b6131468782860161301f565b60c08301525095945050505050565b808201808211156108a6576108a6612d4b565b60006080828403121561317a57600080fd5b6131826125b3565b9050815181526020808301516131978161251a565b828201526040838101519083015260608301516001600160401b038111156131be57600080fd5b8301601f810185136131cf57600080fd5b80516131dd61268d82612649565b81815260059190911b820183019083810190878311156131fc57600080fd5b928401925b8284101561321a57835182529284019290840190613201565b6060860152509295945050505050565b6000602080838503121561323d57600080fd5b82516001600160401b038082111561325457600080fd5b818501915085601f83011261326857600080fd5b815161327661268d82612649565b81815260059190911b8301840190848101908883111561329557600080fd5b8585015b838110156132cd578051858111156132b15760008081fd5b6132bf8b89838a0101613168565b845250918601918601613299565b5098975050505050505050565b6000602082840312156132ec57600080fd5b6108a382612ff4565b600082601f83011261330657600080fd5b815161331461268d826126e0565b81815284602083860101111561332957600080fd5b61201a826020830160208701612899565b60006040828403121561334c57600080fd5b613354612569565b90508151815260208201516001600160401b0381111561337357600080fd5b61337f848285016132f5565b60208301525092915050565b6000806000606084860312156133a057600080fd5b83516133ab8161251a565b60208501519093506133bc8161251a565b60408501519092506001600160401b038111156133d857600080fd5b6133e48682870161333a565b9150509250925092565b60408152600061340160408301856128bd565b90508260208301529392505050565b60408152600061342360408301856128bd565b90506001600160a01b03831660208301529392505050565b60608152600061344e60608301866128bd565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261349557613495613470565b500490565b6000826134a9576134a9613470565b500690565b6000602082840312156134c057600080fd5b81516001600160401b038111156134d657600080fd5b61201a84828501613168565b6000602082840312156134f457600080fd5b815161254c8161251a565b6000806040838503121561351257600080fd5b825161351d8161251a565b60208401519092506001600160401b038082111561353a57600080fd5b9084019081860360a081121561354f57600080fd5b613557612569565b608082121561356557600080fd5b61356d6125d5565b604083121561357b57600080fd5b613583612569565b925084516135908161251a565b808452506020850151602084015282815260408501516020820152606085015160408201528082525060808401519150828211156135cd57600080fd5b6135d9888386016132f5565b6020820152809450505050509250929050565b600061010061360f83885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613643608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613664818401856128bd565b979650505050505050565b60006020828403121561368157600080fd5b81516001600160401b038082111561369857600080fd5b9083019060c082860312156136ac57600080fd5b6136b46125f7565b8251815260208301516136c68161251a565b602082015260408301516136d98161251a565b60408201526060830151828111156136f057600080fd5b6136fc8782860161333a565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b60006020828403121561373457600080fd5b81516001600160401b038082111561374b57600080fd5b9083019060c0828603121561375f57600080fd5b6137676125f7565b825181526020830151602082015260408301518281111561378757600080fd5b613793878286016132f5565b6040830152506060830151828111156137ab57600080fd5b6137b78782860161333a565b6060830152506137c960808401613014565b60808201526137da60a08401613014565b60a082015295945050505050565b600082516137fa818460208701612899565b9190910192915050565b80820281158282048414176108a6576108a6612d4b565b6020815260006108a360208301846128bd56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122066ba78cb9e66b6229d608a9ab5fdd94cb622d29339db457bfddc28c0eccdc13064736f6c63430008130033"; diff --git a/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.ts b/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.ts new file mode 100644 index 0000000..300aa16 --- /dev/null +++ b/src/strategies/DonationVotingMerkleDistributionStrategy/donationVotingVault.config.ts @@ -0,0 +1,1250 @@ +// uses Vault abi, since it's the same like direct transfer + an additional claim function +export const abi = [ + { + inputs: [ + { + internalType: "address", + name: "_allo", + type: "address", + }, + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "contract ISignatureTransfer", + name: "_permit2", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ALLOCATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "ALLOCATION_NOT_ENDED", + type: "error", + }, + { + inputs: [], + name: "ALREADY_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "AMOUNT_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "ANCHOR_ERROR", + type: "error", + }, + { + inputs: [], + name: "ARRAY_MISMATCH", + type: "error", + }, + { + inputs: [], + name: "INVALID", + type: "error", + }, + { + inputs: [], + name: "INVALID_ADDRESS", + type: "error", + }, + { + inputs: [], + name: "INVALID_FEE", + type: "error", + }, + { + inputs: [], + name: "INVALID_METADATA", + type: "error", + }, + { + inputs: [], + name: "INVALID_REGISTRATION", + type: "error", + }, + { + inputs: [], + name: "IS_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "MISMATCH", + type: "error", + }, + { + inputs: [], + name: "NONCE_NOT_AVAILABLE", + type: "error", + }, + { + inputs: [], + name: "NOT_APPROVED_STRATEGY", + type: "error", + }, + { + inputs: [], + name: "NOT_ENOUGH_FUNDS", + type: "error", + }, + { + inputs: [], + name: "NOT_IMPLEMENTED", + type: "error", + }, + { + inputs: [], + name: "NOT_INITIALIZED", + type: "error", + }, + { + inputs: [], + name: "NOT_PENDING_OWNER", + type: "error", + }, + { + inputs: [], + name: "POOL_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "POOL_INACTIVE", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_ALREADY_ACCEPTED", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "RECIPIENT_ERROR", + type: "error", + }, + { + inputs: [], + name: "RECIPIENT_NOT_ACCEPTED", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "REGISTRATION_NOT_ACTIVE", + type: "error", + }, + { + inputs: [], + name: "UNAUTHORIZED", + type: "error", + }, + { + inputs: [], + name: "ZERO_ADDRESS", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Allocated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "BatchPayoutSuccessful", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "Claimed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Distributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + name: "DistributionUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "grantee", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + name: "FundsDistributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "version", + type: "uint8", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "poolId", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool", + }, + ], + name: "PoolActive", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "rowIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fullRow", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RecipientStatusUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "Registered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "registrationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "registrationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationStartTime", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "allocationEndTime", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "TimestampsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipientId", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint8", + name: "status", + type: "uint8", + }, + ], + name: "UpdatedRegistration", + type: "event", + }, + { + inputs: [], + name: "NATIVE", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT2", + outputs: [ + { + internalType: "contract ISignatureTransfer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "allocate", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "allocationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allocationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: + "struct DonationVotingMerkleDistributionVaultStrategy.Claim[]", + name: "_claims", + type: "tuple[]", + }, + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "claims", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "distribute", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributionMetadata", + outputs: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "distributionStarted", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAllo", + outputs: [ + { + internalType: "contract IAllo", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_recipientIds", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "_data", + type: "bytes[]", + }, + ], + name: "getPayouts", + outputs: [ + { + components: [ + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + internalType: "struct IStrategy.PayoutSummary[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipient", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "useRegistryAnchor", + type: "bool", + }, + { + internalType: "address", + name: "recipientAddress", + type: "address", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + internalType: + "struct DonationVotingMerkleDistributionBaseStrategy.Recipient", + name: "recipient", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_recipientId", + type: "address", + }, + ], + name: "getRecipientStatus", + outputs: [ + { + internalType: "enum IStrategy.Status", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getStrategyId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_index", + type: "uint256", + }, + ], + name: "hasBeenDistributed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "increasePoolAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_poolId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isDistributionSet", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isPoolActive", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_allocator", + type: "address", + }, + ], + name: "isValidAllocator", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "merkleRoot", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "metadataRequired", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "recipientToStatusIndexes", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "recipientsCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + { + internalType: "address", + name: "_sender", + type: "address", + }, + ], + name: "registerRecipient", + outputs: [ + { + internalType: "address", + name: "recipientId", + type: "address", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "registrationEndTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "registrationStartTime", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "statusRow", + type: "uint256", + }, + ], + internalType: + "struct DonationVotingMerkleDistributionBaseStrategy.ApplicationStatus[]", + name: "statuses", + type: "tuple[]", + }, + { + internalType: "uint256", + name: "refRecipientsCounter", + type: "uint256", + }, + ], + name: "reviewRecipients", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "statusesBitMap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "totalClaimableAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalPayoutAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_merkleRoot", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "_distributionMetadata", + type: "tuple", + }, + ], + name: "updateDistribution", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "_registrationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_registrationEndTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationStartTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "_allocationEndTime", + type: "uint64", + }, + ], + name: "updatePoolTimestamps", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "useRegistryAnchor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +]; + +export const bytecode = + "0x60e060405260016008553480156200001657600080fd5b5060405162003fd138038062003fd1833981016040819052620000399162000127565b6001600160a01b038316608052604051839083908390839083906200006390829060200162000209565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620000a85760405163538ba4f960e01b815260040160405180910390fd5b6001600160a01b031660c052506200023e9350505050565b6001600160a01b0381168114620000d657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200010c578181015183820152602001620000f2565b50506000910152565b80516200012281620000c0565b919050565b6000806000606084860312156200013d57600080fd5b83516200014a81620000c0565b60208501519093506001600160401b03808211156200016857600080fd5b818601915086601f8301126200017d57600080fd5b815181811115620001925762000192620000d9565b604051601f8201601f19908116603f01168101908382118183101715620001bd57620001bd620000d9565b81604052828152896020848701011115620001d757600080fd5b620001ea836020830160208801620000ef565b8096505050505050620002006040850162000115565b90509250925092565b60208152600082518060208401526200022a816040850160208701620000ef565b601f01601f19169190910160400192915050565b60805160a05160c051613d40620002916000396000818161055a0152612003015260006103e00152600081816102bc01528181611153015281816112bc01528181611b0001526121910152613d406000f3fe60806040526004361061023f5760003560e01c80636afdd8501161012e578063df868ed3116100ab578063edd146cc1161006f578063edd146cc14610770578063ef2920fc14610790578063f31db3d1146107a3578063f5b0dfb7146107c3578063f6f25891146107e357600080fd5b8063df868ed3146106c1578063dff7d2c7146106d6578063e744092e146106fd578063e7efcfc21461072d578063eb11af931461074357600080fd5b8063ac9650d8116100f2578063ac9650d814610601578063b2b878d01461062e578063cb0e85a61461065b578063d26839371461067a578063d2e17f591461069a57600080fd5b80636afdd8501461054857806373af34531461057c57806395355b3b1461059c5780639af5c09d146105b2578063a0cf0aea146105d957600080fd5b806342fda9c7116101bc5780635708973911610180578063570897391461049157806359a3977b146104ab5780635f1b55f3146104ce57806362812a39146104ee5780636923e09a1461051b57600080fd5b806342fda9c7146103d15780634533d678146104045780634ab4ba421461043c5780634d31d0871461045157806351cff8d91461047157600080fd5b80632bbe0cae116102035780632bbe0cae146103445780632d52eff2146103575780632eb4a7ab1461036e57806338fff2d0146103845780633f733c6b1461039957600080fd5b806301fc1c641461024b5780630a6f0ee91461028b57806315cc481e146102ad5780632143e92f146102f4578063217550881461031457600080fd5b3661024657005b600080fd5b34801561025757600080fd5b50610278610266366004612913565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561029757600080fd5b506102ab6102a6366004612b44565b610810565b005b3480156102b957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610282565b34801561030057600080fd5b506102ab61030f366004612bd0565b610830565b34801561032057600080fd5b506005546103349062010000900460ff1681565b6040519015158152602001610282565b6102dc610352366004612c2c565b61092d565b34801561036357600080fd5b50600a541515610334565b34801561037a57600080fd5b50610278600a5481565b34801561039057600080fd5b50600154610278565b3480156103a557600080fd5b506102786103b4366004612c7d565b604360209081526000928352604080842090915290825290205481565b3480156103dd57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610278565b34801561041057600080fd5b50600654610424906001600160401b031681565b6040516001600160401b039091168152602001610282565b34801561044857600080fd5b50600254610278565b34801561045d57600080fd5b5061033461046c366004612913565b610952565b34801561047d57600080fd5b506102ab61048c366004612913565b61095b565b34801561049d57600080fd5b506005546103349060ff1681565b3480156104b757600080fd5b506104c06109f7565b604051610282929190612cfb565b3480156104da57600080fd5b506103346104e9366004612d14565b610a8e565b3480156104fa57600080fd5b5061050e610509366004612913565b610a99565b6040516102829190612d2d565b34801561052757600080fd5b50610278610536366004612913565b60446020526000908152604090205481565b34801561055457600080fd5b506102dc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058857600080fd5b506102ab610597366004612d7c565b610aaa565b3480156105a857600080fd5b5061027860085481565b3480156105be57600080fd5b5060055461042490630100000090046001600160401b031681565b3480156105e557600080fd5b506102dc73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561060d57600080fd5b5061062161061c366004612e15565b610b4c565b6040516102829190612e89565b34801561063a57600080fd5b5061064e610649366004612eeb565b610c40565b6040516102829190612fbf565b34801561066757600080fd5b5060055461033490610100900460ff1681565b34801561068657600080fd5b506102ab61069536600461301f565b610d3e565b3480156106a657600080fd5b5060055461042490600160981b90046001600160401b031681565b3480156106cd57600080fd5b50610334610fa1565b3480156106e257600080fd5b5060055461042490600160581b90046001600160401b031681565b34801561070957600080fd5b50610334610718366004612913565b600e6020526000908152604090205460ff1681565b34801561073957600080fd5b5061027860075481565b34801561074f57600080fd5b5061076361075e366004612913565b610fb0565b6040516102829190613097565b34801561077c57600080fd5b506102ab61078b3660046130bf565b610fbb565b6102ab61079e366004612c2c565b611016565b3480156107af57600080fd5b506102ab6107be366004613105565b61103a565b3480156107cf57600080fd5b506102ab6107de366004612d14565b61111e565b3480156107ef57600080fd5b506102786107fe366004612d14565b600b6020526000908152604090205481565b610818611148565b610820611193565b61082b8383836111b6565b505050565b3361083a81611292565b61084685858585611344565b6005805472ffffffffffffffffffffffffffffffff000000191663010000006001600160401b03888116820267ffffffffffffffff60581b191692909217600160581b88841681029190911767ffffffffffffffff60981b1916600160981b888516810291909117948590556006805467ffffffffffffffff191688861690811790915560408051948704861685529286048516602085015294049092169181019190915260608101919091523360808201527fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39060a00160405180910390a15050505050565b6000610937611148565b61093f611193565b61094983836113de565b90505b92915050565b6000600161094c565b3361096581611292565b60065461097e906001600160401b031662278d006131d5565b6001600160401b031642116109a657604051637fcce2a960e01b815260040160405180910390fd5b60006109b28330611730565b905060006109d5846001600160a01b031660009081526044602052604090205490565b905060006109e382846131f5565b90506109f0853383611779565b5050505050565b6003805460048054919291610a0b90613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3790613208565b8015610a845780601f10610a5957610100808354040283529160200191610a84565b820191906000526020600020905b815481529060010190602001808311610a6757829003601f168201915b5050505050905082565b600061094c826117b3565b610aa16128b8565b61094c826117f4565b610ab26118ed565b33610abc81611292565b60055462010000900460ff1615610ae657604051637fcce2a960e01b815260040160405180910390fd5b600a839055815160039081556020830151839190600490610b079082613288565b509050507fdc7180ca4affc84269428ed20ef950e745126f11691b010c4a7d49458421008f600a546003604051610b3f929190613347565b60405180910390a1505050565b6060816001600160401b03811115610b6657610b66612937565b604051908082528060200260200182016040528015610b9957816020015b6060815260200190600190039081610b845790505b50905060005b82811015610c3957610c0930858584818110610bbd57610bbd6133ec565b9050602002810190610bcf9190613402565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061191892505050565b828281518110610c1b57610c1b6133ec565b60200260200101819052508080610c319061344f565b915050610b9f565b5092915050565b81518151606091908114610c6757604051633da4c02b60e11b815260040160405180910390fd5b6000816001600160401b03811115610c8157610c81612937565b604051908082528060200260200182016040528015610cc657816020015b6040805180820190915260008082526020820152815260200190600190039081610c9f5790505b50905060005b82811015610d3557610d10868281518110610ce957610ce96133ec565b6020026020010151868381518110610d0357610d036133ec565b602002602001015161193d565b828281518110610d2257610d226133ec565b6020908102919091010152600101610ccc565b50949350505050565b610d466119f8565b610d4e6118ed565b8060005b81811015610f91576000848483818110610d6e57610d6e6133ec565b905060400201803603810190610d849190613468565b80516001600160a01b039081166000908152600f602090815260408083208151606081018352815460ff81161515825261010090049095168584015281518083018352600182018054825260028301805498995095979295938701949193909291840191610df190613208565b80601f0160208091040260200160405190810160405280929190818152602001828054610e1d90613208565b8015610e6a5780601f10610e3f57610100808354040283529160200191610e6a565b820191906000526020600020905b815481529060010190602001808311610e4d57829003601f168201915b5050509190925250505090525082516001600160a01b03908116600090815260436020908152604080832082880151909416835292905290812054919250819003610ec857604051637fcce2a960e01b815260040160405180910390fd5b6020808401805185516001600160a01b03908116600090815260438552604080822094518316825293855283812081905590821681526044909352908220805491928492610f179084906131f5565b92505081905550610f2d81846020015184611779565b8351602084810151604080516001600160a01b03928316815292830186905284821683820152519216917f0ffa55c11cec5055a4f567b0ff6e1e0eef2af17baafddd35f31ab4ed1afb75469181900360600190a2505060019092019150610d529050565b5050610f9d6001601155565b5050565b6000610fab611a51565b905090565b600061094c82611a9a565b610fc3611148565b600081806020019051810190610fd99190613538565b9050610fe58382611ab9565b7f91efa3d50feccde0d0d202f8ae5c41ca0b2be614cebcb2bd2f4b019396e6568a8383604051610b3f929190612cfb565b61101e611148565b611026611193565b6110308282611d67565b610f9d8282611f46565b6110426120fd565b3361104c81611292565b600854821461106e57604051637fcce2a960e01b815260040160405180910390fd5b60005b835181101561111857600084828151811061108e5761108e6133ec565b602002602001015160000151905060008583815181106110b0576110b06133ec565b6020908102919091018101518101516000848152600b83526040908190208290558051828152339381019390935290925083917f941884a9a55191a7401466aaf8a0d2b7c8b082055a5a2b345b83c73940172ac4910160405180910390a25050600101611071565b50505050565b611126611148565b8060026000828254611138919061360a565b9091555061114590508181565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111915760405163075fd2b160e01b815260040160405180910390fd5b565b60015460000361119157604051630f68fe6360e21b815260040160405180910390fd5b806111c081611292565b600a546000036111e357604051637fcce2a960e01b815260040160405180910390fd5b60055462010000900460ff16611205576005805462ff00001916620100001790555b60008380602001905181019061121b91906136df565b805190915060005b818110156112555761124d838281518110611240576112406133ec565b6020026020010151612128565b600101611223565b506040516001600160a01b038516907f7ec3272052827f7b50d9e84f98172cbb80c112df1e377c5b97ea77f1812db8d990600090a2505050505050565b6001546040516329e40d4b60e01b815260048101919091526001600160a01b0382811660248301527f000000000000000000000000000000000000000000000000000000000000000016906329e40d4b90604401602060405180830381865afa158015611303573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611327919061378f565b6111455760405163075fd2b160e01b815260040160405180910390fd5b836001600160401b031642118061136c5750826001600160401b0316846001600160401b0316115b806113885750816001600160401b0316846001600160401b0316115b806113a45750806001600160401b0316826001600160401b0316115b806113c05750806001600160401b0316836001600160401b0316115b1561111857604051637fcce2a960e01b815260040160405180910390fd5b60006113e86122be565b600080600061140a604051806040016040528060008152602001606081525090565b60055460ff161561145c57868060200190518101906114299190613840565b9196509350905061143a858761230e565b6114575760405163075fd2b160e01b815260040160405180910390fd5b6114c7565b868060200190518101906114709190613840565b6001600160a01b038316151596509094509092509050836114915785611493565b815b94508380156114a957506114a7858761230e565b155b156114c75760405163075fd2b160e01b815260040160405180910390fd5b600554610100900460ff1680156114ea575060208101515115806114ea57508051155b156115085760405163c19e07c560e01b815260040160405180910390fd5b6001600160a01b03831661153f5760405163f4a513b960e01b81526001600160a01b03861660048201526024015b60405180910390fd5b6001600160a01b038086166000908152600f6020908152604090912080549286166101000274ffffffffffffffffffffffffffffffffffffffff00199093169290921782558251600183019081559083015183919060028401906115a39082613288565b505060055460ff1690506115b757846115ba565b60015b815460ff19169015151781556001600160a01b0386166000908152600c60205260408120549003611696576008546001600160a01b0387166000908152600c60205260409020556116108660015b60ff16612406565b6000886008546040516020016116279291906138a3565b6040516020818303038152906040529050866001600160a01b03167fa197306e3dd5494a61a695381aa809a53b8e377a685e84e404a85d5a8da6cc62828a6040516116739291906138c5565b60405180910390a26008805490600061168b8361344f565b919050555050611725565b60006116a187612439565b905060011960ff8216016116bf576116ba876001611608565b6116d6565b60021960ff8216016116d6576116d6876004611608565b866001600160a01b03167fcec1da3f7f0b8a344dd1025d06e2ddd48b14880395997ad97cbdb439acc761d48a8a61170c8b612439565b60405161171b939291906138f0565b60405180910390a2505b505050505092915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161176857506001600160a01b0381163161094c565b611772838361247a565b905061094c565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038416016117a85761082b82826124af565b61082b8383836124cb565b6000806117c26101008461393b565b905060006117d26101008561394f565b6000928352600d602052604090922054600190921b9182169091149392505050565b6117fc6128b8565b6001600160a01b038083166000908152600f60209081526040918290208251606081018452815460ff81161515825261010090049094168483015282518084018452600182018054825260028301805493958701949293919284019161186190613208565b80601f016020809104026020016040519081016040528092919081815260200182805461188d90613208565b80156118da5780601f106118af576101008083540402835291602001916118da565b820191906000526020600020905b8154815290600101906020018083116118bd57829003601f168201915b5050509190925250505090525092915050565b6006546001600160401b0316421161119157604051634543ced160e11b815260040160405180910390fd5b60606109498383604051806060016040528060278152602001613ce46027913961251a565b60408051808201909152600080825260208201526000828060200190518101906119679190613963565b80516020820151604083015160608401519394509192909190600061198b846117f4565b60200151905061199e8585838686612592565b156119ce576040518060400160405280826001600160a01b0316815260200184815250965050505050505061094c565b604080518082019091526001600160a01b0390911681526000602082015298975050505050505050565b600260115403611a4a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611536565b6002601155565b6005546000904263010000009091046001600160401b031611801590611a895750600554600160581b90046001600160401b03164211155b15611a945750600190565b50600090565b6000611aa582612439565b60ff16600681111561094c5761094c613081565b611ac28261263b565b80516005805460208085015161ffff1990921693151561ff001916939093176101009115159190910217905560408051635ab1bd5360e01b815290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635ab1bd5392600480820193918290030181865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190613997565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556040810151600580546060840151608085015172ffffffffffffffffffffffffffffffff0000001990921663010000006001600160401b03958616810267ffffffffffffffff60581b191691909117600160581b92861683021767ffffffffffffffff60981b1916600160981b9386168402179384905560a08601516006805467ffffffffffffffff19169187169182179055611c4d959185048216949283048216939092041690611344565b60055460065460408051630100000084046001600160401b039081168252600160581b850481166020830152600160981b909404841681830152929091166060830152336080830152517fcb0fb7a7b87db2f472ee8977444cfdbc51993ce660aca27a5969a724fae6dcf39181900360a00190a160c0810151516000819003611d065760008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c805460ff191660011790555b60005b81811015611118576001600e60008560c001518481518110611d2d57611d2d6133ec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611d09565b611d6f61268a565b60008083806020019051810190611d8691906139b4565b80515160208101519051929450909250906002611da285612439565b60ff166006811115611db657611db6613081565b6006811115611dc757611dc7613081565b14611df05760405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b6001600160a01b0381166000908152600e602052604090205460ff16158015611e44575060008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c5460ff16155b15611e6257604051637fcce2a960e01b815260040160405180910390fd5b600034118015611e8f57506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14155b80611ec157506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015611ec15750813414155b15611edf57604051637fcce2a960e01b815260040160405180910390fd5b836001600160a01b03167f463ffc2cf8b1596445c417388ed30e53eb67cf6668cb2be7f0addf8a78c8441b838388604051611f36939291909283526001600160a01b03918216602084015216604082015260600190565b60405180910390a2505050505050565b60008083806020019051810190611f5d91906139b4565b8051518051602090910151929450909250908073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601611fc55781341015611fb6576040516374c5672b60e01b815260040160405180910390fd5b611fc030836124af565b61208b565b6000611fd1843061247a565b85516040805180820182523081526020808201889052890151915163187945bd60e11b81529394506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936330f28b7a9361203c939092918d9190600401613aa1565b600060405180830381600087803b15801561205657600080fd5b505af115801561206a573d6000803e3d6000fd5b50505050600061207a853061247a565b905061208682826131f5565b925050505b6001600160a01b038086166000908152604360209081526040808320938716835292905290812080548392906120c290849061360a565b90915550506001600160a01b038316600090815260446020526040812080548392906120ef90849061360a565b909155505050505050505050565b6006546001600160401b03164211156111915760405162b828c960e81b815260040160405180910390fd5b805160208083015160408085015160608601516001600160a01b038085166000908152600f90965292909420549293909290916101009091041661216f8585838686612592565b156122925760015460405163068bcd8d60e01b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163068bcd8d916121c89160040190815260200190565b600060405180830381865afa1580156121e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261220d9190810190613b24565b9050612218866126d2565b836002600082825461222a91906131f5565b9091555050604081015161223f908386611779565b60408082015181518681526001600160a01b038581166020830152808916939216917fa6b66f665010d2f7435f110111aaa34b56564074f66081bef606d996fc8caa6f910160405180910390a3506122b6565b60405163f4a513b960e01b81526001600160a01b0385166004820152602401611536565b505050505050565b6005544263010000009091046001600160401b031611806122f05750600554600160581b90046001600160401b031642115b1561119157604051635b04f6ad60e11b815260040160405180910390fd5b60095460405163dd93da4360e01b81526001600160a01b038481166004830152600092839291169063dd93da4390602401600060405180830381865afa15801561235c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123849190810190613bd7565b6009548151604051635e8a791560e01b815260048101919091526001600160a01b038681166024830152929350911690635e8a791590604401602060405180830381865afa1580156123da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fe919061378f565b949350505050565b600080600061241485612710565b6000928352600b602052604090922095811b600f90911b199091161790935550505050565b6001600160a01b0381166000908152600c6020526040812054810361246057506000919050565b60008061246c84612710565b600f911c1695945050505050565b6000816014526f70a0823100000000000000000000000060005260208060246010865afa601f3d111660205102905092915050565b60008060008084865af1610f9d5763b12d13eb6000526004601cfd5b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d156001600051141716612510576390b8ec186000526004601cfd5b6000603452505050565b6060600080856001600160a01b0316856040516125379190613c9d565b600060405180830381855af49150503d8060008114612572576040519150601f19603f3d011682016040523d82523d6000602084013e612577565b606091505b509150915061258886838387612783565b9695505050505050565b600061259d866117b3565b156125aa57506000612632565b60408051602081018890526001600160a01b038088169282019290925290851660608201526080810184905260009060a00160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061261e83600a54836127fc565b61262c576000915050612632565b60019150505b95945050505050565b612643611148565b600154156126645760405163439a74c960e01b815260040160405180910390fd5b8060000361268557604051637fcce2a960e01b815260040160405180910390fd5b600155565b60055442600160981b9091046001600160401b031611806126b557506006546001600160401b031642115b156111915760405162b828c960e81b815260040160405180910390fd5b60006126e06101008361393b565b905060006126f06101008461394f565b6000928352600d60205260409092208054600190931b9092179091555050565b6001600160a01b0381166000908152600c602052604081205481908190819061273b906001906131f5565b9050600061274a60408361393b565b9050600061275960408461394f565b612764906004613cb9565b6000838152600b60205260409020549298909750919550909350505050565b606083156127f25782516000036127eb576001600160a01b0385163b6127eb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611536565b50816123fe565b6123fe8383612812565b600082612809858461283c565b14949350505050565b8151156128225781518083602001fd5b8060405162461bcd60e51b81526004016115369190613cd0565b600081815b84518110156128815761286d82868381518110612860576128606133ec565b6020026020010151612889565b9150806128798161344f565b915050612841565b509392505050565b60008183106128a5576000828152602084905260409020610949565b6000838152602083905260409020610949565b604051806060016040528060001515815260200160006001600160a01b031681526020016128f9604051806040016040528060008152602001606081525090565b905290565b6001600160a01b038116811461114557600080fd5b60006020828403121561292557600080fd5b8135612930816128fe565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561296f5761296f612937565b60405290565b60405160e081016001600160401b038111828210171561296f5761296f612937565b604051608081016001600160401b038111828210171561296f5761296f612937565b604051606081016001600160401b038111828210171561296f5761296f612937565b60405160c081016001600160401b038111828210171561296f5761296f612937565b604051601f8201601f191681016001600160401b0381118282101715612a2557612a25612937565b604052919050565b60006001600160401b03821115612a4657612a46612937565b5060051b60200190565b600082601f830112612a6157600080fd5b81356020612a76612a7183612a2d565b6129fd565b82815260059290921b84018101918181019086841115612a9557600080fd5b8286015b84811015612ab9578035612aac816128fe565b8352918301918301612a99565b509695505050505050565b60006001600160401b03821115612add57612add612937565b50601f01601f191660200190565b6000612af9612a7184612ac4565b9050828152838383011115612b0d57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b3557600080fd5b61094983833560208501612aeb565b600080600060608486031215612b5957600080fd5b83356001600160401b0380821115612b7057600080fd5b612b7c87838801612a50565b94506020860135915080821115612b9257600080fd5b50612b9f86828701612b24565b9250506040840135612bb0816128fe565b809150509250925092565b6001600160401b038116811461114557600080fd5b60008060008060808587031215612be657600080fd5b8435612bf181612bbb565b93506020850135612c0181612bbb565b92506040850135612c1181612bbb565b91506060850135612c2181612bbb565b939692955090935050565b60008060408385031215612c3f57600080fd5b82356001600160401b03811115612c5557600080fd5b612c6185828601612b24565b9250506020830135612c72816128fe565b809150509250929050565b60008060408385031215612c9057600080fd5b8235612c9b816128fe565b91506020830135612c72816128fe565b60005b83811015612cc6578181015183820152602001612cae565b50506000910152565b60008151808452612ce7816020860160208601612cab565b601f01601f19169290920160200192915050565b8281526040602082015260006123fe6040830184612ccf565b600060208284031215612d2657600080fd5b5035919050565b602081528151151560208201526001600160a01b036020830151166040820152600060408301516060808401528051608084015260208101519050604060a08401526123fe60c0840182612ccf565b60008060408385031215612d8f57600080fd5b8235915060208301356001600160401b0380821115612dad57600080fd5b9084019060408287031215612dc157600080fd5b612dc961294d565b82358152602083013582811115612ddf57600080fd5b80840193505086601f840112612df457600080fd5b612e0387843560208601612aeb565b60208201528093505050509250929050565b60008060208385031215612e2857600080fd5b82356001600160401b0380821115612e3f57600080fd5b818501915085601f830112612e5357600080fd5b813581811115612e6257600080fd5b8660208260051b8501011115612e7757600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612ede57603f19888603018452612ecc858351612ccf565b94509285019290850190600101612eb0565b5092979650505050505050565b60008060408385031215612efe57600080fd5b82356001600160401b0380821115612f1557600080fd5b612f2186838701612a50565b9350602091508185013581811115612f3857600080fd5b8501601f81018713612f4957600080fd5b8035612f57612a7182612a2d565b81815260059190911b82018401908481019089831115612f7657600080fd5b8584015b83811015612fae57803586811115612f925760008081fd5b612fa08c8983890101612b24565b845250918601918601612f7a565b508096505050505050509250929050565b602080825282518282018190526000919060409081850190868401855b828110156130125761300284835180516001600160a01b03168252602090810151910152565b9284019290850190600101612fdc565b5091979650505050505050565b6000806020838503121561303257600080fd5b82356001600160401b038082111561304957600080fd5b818501915085601f83011261305d57600080fd5b81358181111561306c57600080fd5b8660208260061b8501011115612e7757600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600783106130b957634e487b7160e01b600052602160045260246000fd5b91905290565b600080604083850312156130d257600080fd5b8235915060208301356001600160401b038111156130ef57600080fd5b6130fb85828601612b24565b9150509250929050565b600080604080848603121561311957600080fd5b83356001600160401b0381111561312f57600080fd5b8401601f8101861361314057600080fd5b80356020613150612a7183612a2d565b82815260069290921b8301810191818101908984111561316f57600080fd5b938201935b838510156131af5785858b03121561318c5760008081fd5b61319461294d565b85358152838601358482015282529385019390820190613174565b9997909101359750505050505050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115610c3957610c396131bf565b8181038181111561094c5761094c6131bf565b600181811c9082168061321c57607f821691505b60208210810361323c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561082b57600081815260208120601f850160051c810160208610156132695750805b601f850160051c820191505b818110156122b657828155600101613275565b81516001600160401b038111156132a1576132a1612937565b6132b5816132af8454613208565b84613242565b602080601f8311600181146132ea57600084156132d25750858301515b600019600386901b1c1916600185901b1785556122b6565b600085815260208120601f198616915b82811015613319578886015182559484019460019091019084016132fa565b50858210156133375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b82815260006020604081840152835460408401526001808501604060608601526000815461337481613208565b80608089015260a08583166000811461339457600181146133ae576133dc565b60ff1984168a83015282151560051b8a01820194506133dc565b856000528760002060005b848110156133d45781548c82018501529088019089016133b9565b8b0183019550505b50929a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261341957600080fd5b8301803591506001600160401b0382111561343357600080fd5b60200191503681900382131561344857600080fd5b9250929050565b600060018201613461576134616131bf565b5060010190565b60006040828403121561347a57600080fd5b61348261294d565b823561348d816128fe565b8152602083013561349d816128fe565b60208201529392505050565b805180151581146134b957600080fd5b919050565b80516134b981612bbb565b80516134b9816128fe565b600082601f8301126134e557600080fd5b815160206134f5612a7183612a2d565b82815260059290921b8401810191818101908684111561351457600080fd5b8286015b84811015612ab957805161352b816128fe565b8352918301918301613518565b60006020828403121561354a57600080fd5b81516001600160401b038082111561356157600080fd5b9083019060e0828603121561357557600080fd5b61357d612975565b613586836134a9565b8152613594602084016134a9565b60208201526135a5604084016134be565b60408201526135b6606084016134be565b60608201526135c7608084016134be565b60808201526135d860a084016134be565b60a082015260c0830151828111156135ef57600080fd5b6135fb878286016134d4565b60c08301525095945050505050565b8082018082111561094c5761094c6131bf565b60006080828403121561362f57600080fd5b613637612997565b90508151815260208083015161364c816128fe565b828201526040838101519083015260608301516001600160401b0381111561367357600080fd5b8301601f8101851361368457600080fd5b8051613692612a7182612a2d565b81815260059190911b820183019083810190878311156136b157600080fd5b928401925b828410156136cf578351825292840192908401906136b6565b6060860152509295945050505050565b600060208083850312156136f257600080fd5b82516001600160401b038082111561370957600080fd5b818501915085601f83011261371d57600080fd5b815161372b612a7182612a2d565b81815260059190911b8301840190848101908883111561374a57600080fd5b8585015b83811015613782578051858111156137665760008081fd5b6137748b89838a010161361d565b84525091860191860161374e565b5098975050505050505050565b6000602082840312156137a157600080fd5b610949826134a9565b600082601f8301126137bb57600080fd5b81516137c9612a7182612ac4565b8181528460208386010111156137de57600080fd5b6123fe826020830160208701612cab565b60006040828403121561380157600080fd5b61380961294d565b90508151815260208201516001600160401b0381111561382857600080fd5b613834848285016137aa565b60208301525092915050565b60008060006060848603121561385557600080fd5b8351613860816128fe565b6020850151909350613871816128fe565b60408501519092506001600160401b0381111561388d57600080fd5b613899868287016137ef565b9150509250925092565b6040815260006138b66040830185612ccf565b90508260208301529392505050565b6040815260006138d86040830185612ccf565b90506001600160a01b03831660208301529392505050565b6060815260006139036060830186612ccf565b90506001600160a01b038416602083015260ff83166040830152949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261394a5761394a613925565b500490565b60008261395e5761395e613925565b500690565b60006020828403121561397557600080fd5b81516001600160401b0381111561398b57600080fd5b6123fe8482850161361d565b6000602082840312156139a957600080fd5b8151612930816128fe565b600080604083850312156139c757600080fd5b82516139d2816128fe565b60208401519092506001600160401b03808211156139ef57600080fd5b9084019081860360a0811215613a0457600080fd5b613a0c61294d565b6080821215613a1a57600080fd5b613a226129b9565b6040831215613a3057600080fd5b613a3861294d565b92508451613a45816128fe565b80845250602085015160208401528281526040850151602082015260608501516040820152808252506080840151915082821115613a8257600080fd5b613a8e888386016137aa565b6020820152809450505050509250929050565b6000610100613ac483885180516001600160a01b03168252602090810151910152565b6020870151604084015260408701516060840152613af8608084018780516001600160a01b03168252602090810151910152565b6001600160a01b03851660c08401528060e0840152613b1981840185612ccf565b979650505050505050565b600060208284031215613b3657600080fd5b81516001600160401b0380821115613b4d57600080fd5b9083019060c08286031215613b6157600080fd5b613b696129db565b825181526020830151613b7b816128fe565b60208201526040830151613b8e816128fe565b6040820152606083015182811115613ba557600080fd5b613bb1878286016137ef565b6060830152506080830151608082015260a083015160a082015280935050505092915050565b600060208284031215613be957600080fd5b81516001600160401b0380821115613c0057600080fd5b9083019060c08286031215613c1457600080fd5b613c1c6129db565b8251815260208301516020820152604083015182811115613c3c57600080fd5b613c48878286016137aa565b604083015250606083015182811115613c6057600080fd5b613c6c878286016137ef565b606083015250613c7e608084016134c9565b6080820152613c8f60a084016134c9565b60a082015295945050505050565b60008251613caf818460208701612cab565b9190910192915050565b808202811582820484141761094c5761094c6131bf565b6020815260006109496020830184612ccf56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e54d4f5d1215084dfd06cbe16897419283743e107aae5cef8af599b3032c82c064736f6c63430008130033"; diff --git a/src/strategies/DonationVotingMerkleDistributionStrategy/types.ts b/src/strategies/DonationVotingMerkleDistributionStrategy/types.ts index 2898793..3cadeb9 100644 --- a/src/strategies/DonationVotingMerkleDistributionStrategy/types.ts +++ b/src/strategies/DonationVotingMerkleDistributionStrategy/types.ts @@ -11,6 +11,12 @@ export type Recipient = { metadata: Metadata; }; +export type RegisterDataDonationVoting = { + registryAnchor: `0x${string}`; + recipientAddress: `0x${string}`; + metadata: Metadata; +}; + export type Distribution = { index: number; recipientId: string; @@ -18,17 +24,33 @@ export type Distribution = { merkleProof: string[]; }; -export type InitializeData = { +export type InitializeParamsDonationVoting = { useRegistryAnchor: boolean; metadataRequired: boolean; - registrationStartTime: number; - registrationEndTime: number; - allocationStartTime: number; - allocationEndTime: number; - allowedTokens: string[]; + registrationStartTime: bigint; + registrationEndTime: bigint; + allocationStartTime: bigint; + allocationEndTime: bigint; + allowedTokens: `0x${string}`[]; +}; + +export type TokenPermissions = { + token: `0x${string}`; + amount: bigint; +}; + +export type PermitTransferFrom = { + permitted: TokenPermissions; + nonce: bigint; + deadline: bigint; }; export type Permit2Data = { - permit: any; - signature: string; + permit: PermitTransferFrom; + signature: `0x${string}`; +}; + +export const StrategyTypeDonationVoting = { + Vault: "DonationVotingMerkleDistributionVaultv1", + Direct: "DonationVotingMerkleDistributionDirectTransferv1", }; diff --git a/tsconfig.json b/tsconfig.json index 452c5db..51fee4c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,12 @@ { - "compilerOptions": { - "target": "ES6", - "module": "CommonJS", - "declaration": true, - "outDir": "./dist", - "strict": true - }, - "include": ["src/**/*"] - } + "compilerOptions": { + "target": "ES6", + "module": "CommonJS", + "declaration": true, + "outDir": "./dist", + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["**/*ignore*/**"] +} \ No newline at end of file From 68a41d90ad07bfa658f19cd9d05cda83a0c841c8 Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Wed, 20 Dec 2023 14:05:59 +0100 Subject: [PATCH 2/4] ignore tests --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index f875448..8e8f03f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,5 +5,6 @@ module.exports = { testPathIgnorePatterns: [ "/src/__tests__/utils/", "/dist/__tests__/utils/", + "/dist/__tests__ignore/", ], }; \ No newline at end of file From f78adaa722753e4688b8d371811b917ec9dd00ed Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Wed, 20 Dec 2023 14:09:54 +0100 Subject: [PATCH 3/4] adding dummy tes --- dist/__tests__/Allo/Allo.test.d.ts | 1 - dist/__tests__/Allo/Allo.test.js | 276 --------------- dist/__tests__/Registry/Registry.test.d.ts | 2 - dist/__tests__/Registry/Registry.test.js | 210 ------------ .../Strategy/DonationVoting.test.d.ts | 1 - .../__tests__/Strategy/DonationVoting.test.js | 317 ------------------ dist/__tests__/Strategy/MicroGrants.test.d.ts | 1 - dist/__tests__/Strategy/MicroGrants.test.js | 74 ---- dist/__tests__/dummy.d.ts | 0 dist/__tests__/dummy.js | 6 + dist/__tests__/utils/utils.d.ts | 3 - dist/__tests__/utils/utils.js | 16 - jest.config.js | 2 + src/__tests__/dummy.ts | 5 + 14 files changed, 13 insertions(+), 901 deletions(-) delete mode 100644 dist/__tests__/Allo/Allo.test.d.ts delete mode 100644 dist/__tests__/Allo/Allo.test.js delete mode 100644 dist/__tests__/Registry/Registry.test.d.ts delete mode 100644 dist/__tests__/Registry/Registry.test.js delete mode 100644 dist/__tests__/Strategy/DonationVoting.test.d.ts delete mode 100644 dist/__tests__/Strategy/DonationVoting.test.js delete mode 100644 dist/__tests__/Strategy/MicroGrants.test.d.ts delete mode 100644 dist/__tests__/Strategy/MicroGrants.test.js create mode 100644 dist/__tests__/dummy.d.ts create mode 100644 dist/__tests__/dummy.js delete mode 100644 dist/__tests__/utils/utils.d.ts delete mode 100644 dist/__tests__/utils/utils.js create mode 100644 src/__tests__/dummy.ts diff --git a/dist/__tests__/Allo/Allo.test.d.ts b/dist/__tests__/Allo/Allo.test.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/__tests__/Allo/Allo.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/__tests__/Allo/Allo.test.js b/dist/__tests__/Allo/Allo.test.js deleted file mode 100644 index b9f4403..0000000 --- a/dist/__tests__/Allo/Allo.test.js +++ /dev/null @@ -1,276 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const Allo_1 = require("../../Allo/Allo"); -const utils_1 = require("../utils/utils"); -const address = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; -const metadata = { - protocol: BigInt(1), - pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", -}; -jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { - return { - read: { - isPoolAdmin: jest.fn(() => true), - isPoolManager: jest.fn(() => true), - isCloneableStrategy: jest.fn(() => true), - getStrategy: jest.fn(() => (0, utils_1.makeAddress)("STRATEGY")), - getPercentFee: jest.fn(() => 0), - getBaseFee: jest.fn(() => 0), - getTreasury: jest.fn(() => (0, utils_1.makeAddress)("TREASURY")), - getRegistry: jest.fn(() => (0, utils_1.makeAddress)("REGISTRY")), - getPool: jest.fn(() => ({ - id: 1, - name: "Pool 1", - symbol: "P1", - manager: (0, utils_1.makeAddress)("MANAGER"), - strategy: (0, utils_1.makeAddress)("STRATEGY"), - baseFee: 0, - percentFee: 0, - treasury: (0, utils_1.makeAddress)("TREASURY"), - })), - getFeeDenominator: jest.fn(() => 100), - }, - }; - }) }))); -describe("Allo", () => { - let allo; - beforeEach(() => { - allo = new Allo_1.Allo({ chain: 5 }); - }); - // Test cases for view functions - describe("View Functions", () => { - it("should return if the address is a pool admin", () => __awaiter(void 0, void 0, void 0, function* () { - const isAdmin = yield allo.isPoolAdmin(1, (0, utils_1.makeAddress)("ADMIN")); - expect(isAdmin).toEqual(true); - })); - it("should return if the address is a pool manager", () => __awaiter(void 0, void 0, void 0, function* () { - const isManager = yield allo.isPoolManager(1, (0, utils_1.makeAddress)("MANAGER")); - expect(isManager).toEqual(true); - })); - it("should get if the strategy is cloneable", () => __awaiter(void 0, void 0, void 0, function* () { - const isCloneable = yield allo.isCloneableStrategy(); - expect(isCloneable).toEqual(true); - })); - it("should get the strategy", () => __awaiter(void 0, void 0, void 0, function* () { - const strategy = yield allo.getStrategy(1); - expect(strategy).toEqual((0, utils_1.makeAddress)("STRATEGY")); - })); - it("should get fee percentage", () => __awaiter(void 0, void 0, void 0, function* () { - const percentFee = yield allo.getPercentFee(); - expect(percentFee).toEqual(0); - })); - it("should get the base fee", () => __awaiter(void 0, void 0, void 0, function* () { - const baseFee = yield allo.getBaseFee(); - expect(baseFee).toEqual(0); - })); - it("should get the treasury", () => __awaiter(void 0, void 0, void 0, function* () { - const treasury = yield allo.getTreasury(); - expect(treasury).toEqual((0, utils_1.makeAddress)("TREASURY")); - })); - it("should get the registry", () => __awaiter(void 0, void 0, void 0, function* () { - const registry = yield allo.getRegistry(); - expect(registry).toEqual((0, utils_1.makeAddress)("REGISTRY")); - })); - it("should get the pool", () => __awaiter(void 0, void 0, void 0, function* () { - const pool = yield allo.getPool(1); - expect(pool).toEqual({ - id: 1, - name: "Pool 1", - symbol: "P1", - manager: (0, utils_1.makeAddress)("MANAGER"), - strategy: (0, utils_1.makeAddress)("STRATEGY"), - baseFee: 0, - percentFee: 0, - treasury: (0, utils_1.makeAddress)("TREASURY"), - }); - })); - it("should get the fee denominator", () => __awaiter(void 0, void 0, void 0, function* () { - const feeDenominator = yield allo.getFeeDenominator(); - expect(feeDenominator).toEqual(100); - })); - }); - // Test cases for write functions - describe("Write Functions", () => { - it("should create a pool", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.createPool({ - profileId: (0, utils_1.makeBytes32)("PROFILE"), - strategy: (0, utils_1.makeAddress)("STRATEGY"), - initStrategyData: "0x", - token: (0, utils_1.makeAddress)("TOKEN"), - amount: BigInt(0), - metadata: metadata, - managers: [(0, utils_1.makeAddress)("MANAGER")], - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should create a pool with custom strategy", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.createPoolWithCustomStrategy({ - profileId: (0, utils_1.makeBytes32)("PROFILE"), - strategy: (0, utils_1.makeAddress)("STRATEGY"), - initStrategyData: "0x", - token: (0, utils_1.makeAddress)("TOKEN"), - amount: BigInt(0), - metadata, - managers: [(0, utils_1.makeAddress)("MANAGER")], - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the pool metadata", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.updatePoolMetadata({ - poolId: 1, - metadata: { - protocol: BigInt(1), - pointer: "bafybeia4khbew3r2mkfly23nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", - }, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the registry address", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.updateRegistry((0, utils_1.makeAddress)("REGISTRY")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the treasury address", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.updateTreasury((0, utils_1.makeAddress)("TREASURY")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the percent fee", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.updatePercentFee(1); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the base fee", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.updateBaseFee(1); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should add strategy to cloneable strategies", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.addToCloneableStrategies((0, utils_1.makeAddress)("STRATEGY2")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should remove strategy to cloneable strategies", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.removeFromCloneableStrategies((0, utils_1.makeAddress)("STRATEGY2")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should add pool manager", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.addPoolManager(1, (0, utils_1.makeAddress)("MANAGER2")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should remove pool manager", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.removePoolManager(1, (0, utils_1.makeAddress)("MANAGER2")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should recover funds", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.recoverFunds((0, utils_1.makeAddress)("TOKEN"), (0, utils_1.makeAddress)("RECIPIENT")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - }); - // Test cases for strategy functions - describe("Strategy Functions", () => { - it("should register a recipient", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.registerRecipient(1, (0, utils_1.makeBytes32)("STRATEGY_DATA")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should batch register multiple recipients", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.batchRegisterRecipient([1, 1], [(0, utils_1.makeBytes32)("STRATEGY_DATA"), (0, utils_1.makeBytes32)("STRATEGY_DATA")]); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should fund a pool", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.fundPool(1, 100e18); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should allocate to a recipient", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.allocate(1, (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should batch allocate to multiple recipients", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.batchAllocate([1, 1], [ - (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA"), - (0, utils_1.makeBytes32)("STRATEGY_ALLOCATE_DATA"), - ]); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should distribute funds", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = allo.distribute(1, [(0, utils_1.makeAddress)("RECIPIENT1"), (0, utils_1.makeAddress)("RECIPIENT2")], (0, utils_1.makeBytes32)("STRATEGY_DISTRIBUTE_DATA")); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - }); -}); diff --git a/dist/__tests__/Registry/Registry.test.d.ts b/dist/__tests__/Registry/Registry.test.d.ts deleted file mode 100644 index 1cab1d1..0000000 --- a/dist/__tests__/Registry/Registry.test.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Metadata } from "../../Common/types"; -export declare const metadata: Metadata; diff --git a/dist/__tests__/Registry/Registry.test.js b/dist/__tests__/Registry/Registry.test.js deleted file mode 100644 index 1d3bb43..0000000 --- a/dist/__tests__/Registry/Registry.test.js +++ /dev/null @@ -1,210 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.metadata = void 0; -const Registry_1 = require("../../Registry/Registry"); -const utils_1 = require("../utils/utils"); -const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; -exports.metadata = { - protocol: BigInt(1), - pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", -}; -jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { - return { - read: { - ALLO_OWNER: jest.fn(() => (0, utils_1.makeAddress)("ALLO_OWNER")), - DEFAULT_ADMIN_ROLE: jest.fn(() => (0, utils_1.makeBytes32)("DEFAULT_ADMIN_ROLE")), - NATIVE: jest.fn(() => (0, utils_1.NATIVE)()), - anchorToProfileId: jest.fn(([anchor]) => (0, utils_1.makeBytes32)(anchor)), - getProfileByAnchor: jest.fn(([anchor]) => (0, utils_1.makeBytes32)(anchor)), - getProfileById: jest.fn(([profileId]) => (0, utils_1.makeBytes32)(profileId)), - getRoleAdmin: jest.fn(([role]) => (0, utils_1.makeBytes32)(role)), - hasRole: jest.fn(() => true), - isMemberOfProfile: jest.fn(() => true), - isOwnerOfProfile: jest.fn(() => true), - isOwnerOrMemberOfProfile: jest.fn(() => true), - profileIdToPendingOwner: jest.fn(() => (0, utils_1.makeBytes32)("profileId")), - }, - }; - }) }))); -describe("Registry", () => { - let registry; - beforeEach(() => { - registry = new Registry_1.Registry({ chain: 5 }); - }); - // Test cases for view functions - describe("View Functions", () => { - it("should get ALLO_OWNER", () => __awaiter(void 0, void 0, void 0, function* () { - const allowOwner = yield registry.getAlloOwner(); - expect(allowOwner).toEqual((0, utils_1.makeAddress)("ALLO_OWNER")); - })); - it("should get DEFAULT_ADMIN_ROLE", () => __awaiter(void 0, void 0, void 0, function* () { - const defaultAdminRole = yield registry.getDefaultAdminRole(); - expect(defaultAdminRole).toEqual((0, utils_1.makeBytes32)("DEFAULT_ADMIN_ROLE")); - })); - it("should get NATIVE", () => __awaiter(void 0, void 0, void 0, function* () { - const native = yield registry.getNative(); - expect(native).toEqual((0, utils_1.NATIVE)()); - })); - it("should get anchorToProfileId", () => __awaiter(void 0, void 0, void 0, function* () { - const anchor = (0, utils_1.makeAddress)("anchor"); - const anchorToProfileId = yield registry.getAnchorToProfileId(anchor); - expect(anchorToProfileId).toEqual((0, utils_1.makeBytes32)(anchor)); - })); - it("should get profile by anchor", () => __awaiter(void 0, void 0, void 0, function* () { - const anchor = (0, utils_1.makeAddress)("anchor"); - const profile = yield registry.getProfileByAnchor(anchor); - expect(profile).toEqual((0, utils_1.makeBytes32)(anchor)); - })); - it("should get profile by id", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const profile = yield registry.getProfileById(profileId); - expect(profile).toEqual((0, utils_1.makeBytes32)(profileId)); - })); - it("should get the admin role", () => __awaiter(void 0, void 0, void 0, function* () { - const adminRole = yield registry.getRoleAdmin("role"); - expect(adminRole).toEqual((0, utils_1.makeBytes32)("role")); - })); - it("should check if an account has a role", () => __awaiter(void 0, void 0, void 0, function* () { - const hasRole = yield registry.hasRole({ - role: "role", - account: (0, utils_1.makeAddress)("account"), - }); - expect(hasRole).toEqual(true); - })); - it("should check if an account is a owner of a profile", () => __awaiter(void 0, void 0, void 0, function* () { - const isOwner = yield registry.isOwnerOfProfile({ - profileId: (0, utils_1.makeBytes32)("profileId"), - account: (0, utils_1.makeAddress)("account"), - }); - expect(isOwner).toEqual(true); - })); - it("should check if an account is a member or an owner of a profile", () => __awaiter(void 0, void 0, void 0, function* () { - const isOwnerOrMember = yield registry.isOwnerOrMemberOfProfile({ - profileId: (0, utils_1.makeBytes32)("profileId"), - account: (0, utils_1.makeAddress)("account"), - }); - expect(isOwnerOrMember).toEqual(true); - })); - it("should get the pending owner for a profile id", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = yield registry.profileIdToPendingOwner((0, utils_1.makeBytes32)("pendingOwner")); - expect(profileId).toEqual((0, utils_1.makeBytes32)("profileId")); - })); - }); - // Test cases for write functions - describe("Write Functions", () => { - // Test cases for write functions - it("should create a profile", () => __awaiter(void 0, void 0, void 0, function* () { - const nonce = 1; - const name = "my secret profile"; - const metatdata = { - protocol: BigInt(1), - pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", - }; - const owner = (0, utils_1.makeAddress)("owner"); - const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; - const tx = yield registry.createProfile({ - nonce, - name, - metadata: metatdata, - owner, - members, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should accept profile ownership", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const tx = registry.acceptProfileOwnership(profileId); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should accept profile ownership", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const tx = yield registry.acceptProfileOwnership(profileId); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should add a member to a profile", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; - const tx = yield registry.addMembers({ - profileId, - members, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should remove a member from a profile", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const members = [(0, utils_1.makeAddress)("member1"), (0, utils_1.makeAddress)("member2")]; - const tx = registry.removeMembers({ - profileId, - members, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update profile metadata", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const tx = registry.updateProfileMetadata({ - profileId, - metadata: exports.metadata, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update profile name", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const name = "my secret profile updated"; - const tx = registry.updateProfileName({ - profileId, - name, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update profile pending owner", () => __awaiter(void 0, void 0, void 0, function* () { - const profileId = (0, utils_1.makeBytes32)("profileId"); - const pendingOwner = (0, utils_1.makeAddress)("pendingOwner"); - const tx = registry.updateProfilePendingOwner({ - profileId, - account: pendingOwner, - }); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - }); -}); diff --git a/dist/__tests__/Strategy/DonationVoting.test.d.ts b/dist/__tests__/Strategy/DonationVoting.test.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/__tests__/Strategy/DonationVoting.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/__tests__/Strategy/DonationVoting.test.js b/dist/__tests__/Strategy/DonationVoting.test.js deleted file mode 100644 index daec242..0000000 --- a/dist/__tests__/Strategy/DonationVoting.test.js +++ /dev/null @@ -1,317 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils_1 = require("../utils/utils"); -const DonationVotingMerkleDistribution_1 = require("../../strategies/DonationVotingMerkleDistributionStrategy/DonationVotingMerkleDistribution"); -const alloAddress = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; -const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; -jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { - return { - read: { - NATIVE: jest.fn(() => (0, utils_1.NATIVE)()), - PERMIT2: jest.fn(() => (0, utils_1.makeBytes32)("PERMIT2")), - allocationEndTime: jest.fn(() => 1), - allocationStartTime: jest.fn(() => 1), - allowedTokens: jest.fn(() => true), - claims: jest.fn(() => 0), - getClaims: jest.fn(() => 0), - distributionMetadata: jest.fn(() => ({ - protocol: BigInt(1), - pointer: "unt93847nwg[u7456w7shn56", - })), - distributionStarted: jest.fn(() => true), - getAllo: jest.fn(() => alloAddress), - getPayouts: jest.fn(() => []), - getPoolAmount: jest.fn(() => 0), - getPoolId: jest.fn(() => 0), - getRecipient: jest.fn(() => ({ - recipientId: (0, utils_1.makeAddress)("RECIPIENT1"), - })), - getRecipientStatus: jest.fn(() => 1), - getStrategyId: jest.fn(() => address), - hasBeenDistributed: jest.fn(() => true), - isDistributionSet: jest.fn(() => true), - isPoolActive: jest.fn(() => true), - isValidAllocator: jest.fn(() => true), - merkleRoot: jest.fn(() => "unt93847nwg[u7456w7shn56"), - metadataRequired: jest.fn(() => true), - recipientToStatusIndexes: jest.fn(() => []), - recipientsCounter: jest.fn(() => 0), - registrationStartTime: jest.fn(() => 1), - registrationEndTime: jest.fn(() => 1), - statusesBitMap: jest.fn(() => 0), - totalPayoutAmount: jest.fn(() => 1e18), - useRegistryAnchor: jest.fn(() => true), - }, - }; - }) }))); -describe("DonationVotingMerkleDistributionStrategy", () => { - let strategy; - beforeEach(() => { - strategy = new DonationVotingMerkleDistribution_1.DonationVotingMerkleDistributionStrategy({ - chain: 5, - rpc: "rpc", - address: address, - }); - }); - describe("read functions", () => { - it("should return the native token address", () => __awaiter(void 0, void 0, void 0, function* () { - const native = yield strategy.getNative(); - expect(native).toEqual((0, utils_1.NATIVE)()); - })); - it("should return the permit2 token", () => __awaiter(void 0, void 0, void 0, function* () { - const permit2 = yield strategy.getPermit2(); - expect(permit2).toEqual((0, utils_1.makeBytes32)("PERMIT2")); - })); - it("should return the allocation end time", () => __awaiter(void 0, void 0, void 0, function* () { - const endTime = yield strategy.getAllocationEndTime(); - expect(endTime).toEqual(1); - })); - it("should return the allocation start time", () => __awaiter(void 0, void 0, void 0, function* () { - const startTime = yield strategy.getAllocationStartTime(); - expect(startTime).toEqual(1); - })); - it("should get the allowed tokens", () => __awaiter(void 0, void 0, void 0, function* () { - const allowed = yield strategy.isAllowedTokens((0, utils_1.NATIVE)()); - expect(allowed).toEqual(true); - })); - it("should return the claims", () => __awaiter(void 0, void 0, void 0, function* () { - const claims = yield strategy.getClaims(address, (0, utils_1.NATIVE)()); - expect(claims).toEqual(0); - })); - it("should return distribution metadata", () => __awaiter(void 0, void 0, void 0, function* () { - const metadata = yield strategy.getDistributionMetadata(); - expect(metadata).toEqual({ - protocol: BigInt(1), - pointer: "unt93847nwg[u7456w7shn56", - }); - })); - it("should return if the distribution has started", () => __awaiter(void 0, void 0, void 0, function* () { - const isStarted = yield strategy.getDistributionStarted(); - expect(isStarted).toEqual(true); - })); - it("should return the allo address", () => __awaiter(void 0, void 0, void 0, function* () { - const allo = yield strategy.getAllo(); - expect(allo).toEqual(alloAddress); - })); - it("should get the payouts", () => __awaiter(void 0, void 0, void 0, function* () { - const recipientIds = [ - (0, utils_1.makeAddress)("RECIPIENT1"), - (0, utils_1.makeAddress)("RECIPIENT2"), - ]; - const payoutData = [ - (0, utils_1.makeBytes32)("PAYOUT_DATA"), - (0, utils_1.makeBytes32)("PAYOUT_DATA2"), - ]; - const payouts = yield strategy.getPayouts(recipientIds, payoutData); - expect(payouts).toEqual([]); - })); - it("should get the pool amount", () => __awaiter(void 0, void 0, void 0, function* () { - const poolAmount = yield strategy.getPoolAmount(); - expect(poolAmount).toEqual(0); - })); - it("should get the pool ID", () => __awaiter(void 0, void 0, void 0, function* () { - const poolId = yield strategy.getPoolId(); - expect(poolId).toEqual(0); - })); - it("should get the recipient", () => __awaiter(void 0, void 0, void 0, function* () { - const recipientId = (0, utils_1.makeAddress)("RECIPIENT1"); - const recipient = yield strategy.getRecipient(recipientId); - expect(recipient).toEqual({ - recipientId: (0, utils_1.makeAddress)("RECIPIENT1"), - }); - })); - it("should get the recipient status", () => __awaiter(void 0, void 0, void 0, function* () { - const recipientId = (0, utils_1.makeAddress)("RECIPIENT1"); - const status = yield strategy.getRecipientStatus(recipientId); - expect(status).toEqual(1); - })); - it("should get the strategy ID", () => __awaiter(void 0, void 0, void 0, function* () { - const strategyId = yield strategy.getStrategyId(); - expect(strategyId).toEqual(address); - })); - it("should call hasBeenDistributed()", () => __awaiter(void 0, void 0, void 0, function* () { - const hasBeenDistributed = yield strategy.hasBeenDistributed(0); - expect(hasBeenDistributed).toEqual(true); - })); - it("should return if a distribution is set", () => __awaiter(void 0, void 0, void 0, function* () { - const isSet = yield strategy.isDistributionSet(); - expect(isSet).toEqual(true); - })); - it("should return if a pool is active", () => __awaiter(void 0, void 0, void 0, function* () { - const isActive = yield strategy.isPoolActive(); - expect(isActive).toEqual(true); - })); - it("should return if a valid allocator", () => __awaiter(void 0, void 0, void 0, function* () { - const isAllocator = yield strategy.isValidAllocator(address); - expect(isAllocator).toEqual(true); - })); - it("should get the merkle root", () => __awaiter(void 0, void 0, void 0, function* () { - const root = yield strategy.getMerkleRoot(); - expect(root).toEqual("unt93847nwg[u7456w7shn56"); - })); - it("should return if metadata is required", () => __awaiter(void 0, void 0, void 0, function* () { - const isRequired = yield strategy.metadataRequired(); - expect(isRequired).toEqual(true); - })); - it("should return the recipient to status index", () => __awaiter(void 0, void 0, void 0, function* () { - const indexes = yield strategy.recipientToStatusIndexes((0, utils_1.makeAddress)("RECIPIENT1")); - expect(indexes).toEqual([]); - })); - it("should return the recipients counter", () => __awaiter(void 0, void 0, void 0, function* () { - const counter = yield strategy.recipientsCounter(); - expect(counter).toEqual(0); - })); - it("should return the registration start time", () => __awaiter(void 0, void 0, void 0, function* () { - const startTime = yield strategy.registrationStartTime(); - expect(startTime).toEqual(1); - })); - it("should return the registration end time", () => __awaiter(void 0, void 0, void 0, function* () { - const endTime = yield strategy.registrationEndTime(); - expect(endTime).toEqual(1); - })); - it("should return the statuses bitmap", () => __awaiter(void 0, void 0, void 0, function* () { - const bitmap = yield strategy.statusesBitMap(0); - expect(bitmap).toEqual(0); - })); - it("should return the total payout amount", () => __awaiter(void 0, void 0, void 0, function* () { - const amount = yield strategy.totalPayoutAmount(); - expect(amount).toEqual(1e18); - })); - it("should return whether to use the registry anchor", () => __awaiter(void 0, void 0, void 0, function* () { - const useAnchor = yield strategy.useRegistryAnchor(); - expect(useAnchor).toEqual(true); - })); - }); - describe("write functions", () => { - it("should allocate", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = strategy.allocate((0, utils_1.makeBytes32)("ALLOCATE_DATA")); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should batch allocate", () => __awaiter(void 0, void 0, void 0, function* () { - const data = [ - (0, utils_1.makeBytes32)("ALLOCATE_DATA"), - (0, utils_1.makeBytes32)("ALLOCATE_DATA2"), - ]; - const tx = strategy.batchAllocate(data); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should register a recipient", () => __awaiter(void 0, void 0, void 0, function* () { - const data = (0, utils_1.makeBytes32)("REGISTER_DATA"); - const tx = strategy.registerRecipient(data); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should batch register recipients", () => __awaiter(void 0, void 0, void 0, function* () { - const data = [ - (0, utils_1.makeBytes32)("REGISTER_DATA"), - (0, utils_1.makeBytes32)("REGISTER_DATA2"), - ]; - const tx = strategy.batchRegisterRecipient(data); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should fund the pool", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = strategy.fundPool(100e18); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should distribute funds to recipients", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = strategy.distribute([address, address], (0, utils_1.makeBytes32)("DISTRIBUTE_DATA")); - expect(tx).toEqual({ - to: alloAddress, - data: tx.data, - value: "0", - }); - })); - it("should claim funds", () => __awaiter(void 0, void 0, void 0, function* () { - const data = [ - { recipientId: (0, utils_1.makeAddress)("CLAIMANT1"), token: (0, utils_1.NATIVE)() }, - { recipientId: (0, utils_1.makeAddress)("CLAIMANT2"), token: (0, utils_1.NATIVE)() }, - ]; - const tx = strategy.claim(data); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should call multicall", () => __awaiter(void 0, void 0, void 0, function* () { - const data = [ - (0, utils_1.makeBytes32)("MULTICALL_DATA"), - (0, utils_1.makeBytes32)("MULTICALL_DATA2"), - ]; - const tx = strategy.multicall(data); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should review recipients", () => __awaiter(void 0, void 0, void 0, function* () { - const data = [ - { index: 1, statusRow: 1 }, - { index: 2, statusRow: 2 }, - ]; - const tx = strategy.reviewRecipients(data); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the distribution", () => __awaiter(void 0, void 0, void 0, function* () { - const distributeMetadata = { - protocol: BigInt(1), - pointer: "unt93847nwg[u7456w7shn56", - }; - const tx = strategy.updateDistribution((0, utils_1.makeBytes32)("MERKLE_ROOT"), distributeMetadata); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should update the pool timestamps", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = strategy.updatePoolTimestamps(1000, 2000, 3000, 4000); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - it("should withdraw the funds from the pool", () => __awaiter(void 0, void 0, void 0, function* () { - const tx = strategy.withdraw(1e18); - expect(tx).toEqual({ - to: address, - data: tx.data, - value: "0", - }); - })); - }); -}); diff --git a/dist/__tests__/Strategy/MicroGrants.test.d.ts b/dist/__tests__/Strategy/MicroGrants.test.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/__tests__/Strategy/MicroGrants.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/__tests__/Strategy/MicroGrants.test.js b/dist/__tests__/Strategy/MicroGrants.test.js deleted file mode 100644 index 356f910..0000000 --- a/dist/__tests__/Strategy/MicroGrants.test.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const MicroGrantsStrategy_1 = require("../../strategies/MicroGrantsStrategy/MicroGrantsStrategy"); -const utils_1 = require("../utils/utils"); -// const alloAddress: Address = "0x1133eA7Af70876e64665ecD07C0A0476d09465a1"; -const address = "0xAEc621EC8D9dE4B524f4864791171045d6BBBe27"; -jest.mock("viem", () => (Object.assign(Object.assign({}, jest.requireActual("viem")), { create: jest.fn(() => { }), getContract: jest.fn(() => { - return { - read: { - NATIVE: jest.fn(() => utils_1.NATIVE), - allocationStartTime: jest.fn(() => 1), - allocationEndTime: jest.fn(() => 1), - maxRequestedAmountAllowed: jest.fn(() => 0), - approvalThreshold: jest.fn(() => 0), - allocators: jest.fn(() => true), - allocated: jest.fn(() => true), - recipientAllocations: jest.fn(() => 0), - }, - }; - }) }))); -describe("Micro Grants Strategy", () => { - let strategy; - beforeEach(() => { - strategy = new MicroGrantsStrategy_1.MicroGrantsStrategy({ - chain: 5, - rpc: "rpc", - address, - poolId: 0, - }); - }); - describe("read functions", () => { - it("should return the native token address", () => __awaiter(void 0, void 0, void 0, function* () { - const native = yield strategy.getNative(); - expect(native).toEqual(utils_1.NATIVE); - })); - it("should return the allocation start time", () => __awaiter(void 0, void 0, void 0, function* () { - const startTime = yield strategy.allocationStartTime(); - expect(startTime).toEqual(1); - })); - it("should return the allocation end time", () => __awaiter(void 0, void 0, void 0, function* () { - const endTime = yield strategy.allocationEndTime(); - expect(endTime).toEqual(1); - })); - it("should return the max requested amount", () => __awaiter(void 0, void 0, void 0, function* () { - const maxRequestedAmount = yield strategy.maxRequestedAmount(); - expect(maxRequestedAmount).toEqual(0); - })); - it("should return the approval threshold", () => __awaiter(void 0, void 0, void 0, function* () { - const approvalThreshold = yield strategy.approvalThreshold(); - expect(approvalThreshold).toEqual(0); - })); - it("should return the allocators", () => __awaiter(void 0, void 0, void 0, function* () { - const allocators = yield strategy.allocator("allocator"); - expect(allocators).toEqual(true); - })); - it("should return the allocated", () => __awaiter(void 0, void 0, void 0, function* () { - const allocated = yield strategy.allocated("allocator", "recipient"); - expect(allocated).toEqual(true); - })); - it("should return the recipient allocations", () => __awaiter(void 0, void 0, void 0, function* () { - const recipientAllocations = yield strategy.recipientAllocations("recipient", 0); - expect(recipientAllocations).toEqual(0); - })); - }); -}); diff --git a/dist/__tests__/dummy.d.ts b/dist/__tests__/dummy.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/dist/__tests__/dummy.js b/dist/__tests__/dummy.js new file mode 100644 index 0000000..7959706 --- /dev/null +++ b/dist/__tests__/dummy.js @@ -0,0 +1,6 @@ +"use strict"; +describe("dummy", () => { + it("should be true", () => { + expect(true).toBe(true); + }); +}); diff --git a/dist/__tests__/utils/utils.d.ts b/dist/__tests__/utils/utils.d.ts deleted file mode 100644 index 129b07b..0000000 --- a/dist/__tests__/utils/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const makeAddress: (input: string) => string; -export declare const makeBytes32: (input: string) => string; -export declare const NATIVE: () => string; diff --git a/dist/__tests__/utils/utils.js b/dist/__tests__/utils/utils.js deleted file mode 100644 index 2d5ead4..0000000 --- a/dist/__tests__/utils/utils.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NATIVE = exports.makeBytes32 = exports.makeAddress = void 0; -const viem_1 = require("viem"); -const makeAddress = (input) => { - return (0, viem_1.keccak256)((0, viem_1.toHex)(input)).slice(0, 42); -}; -exports.makeAddress = makeAddress; -const makeBytes32 = (input) => { - return (0, viem_1.keccak256)((0, viem_1.toHex)(input)); -}; -exports.makeBytes32 = makeBytes32; -const NATIVE = () => { - return "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; -}; -exports.NATIVE = NATIVE; diff --git a/jest.config.js b/jest.config.js index 8e8f03f..6240bcd 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,8 +3,10 @@ module.exports = { preset: "ts-jest", testEnvironment: "node", testPathIgnorePatterns: [ + "/dist/__tests__/", "/src/__tests__/utils/", "/dist/__tests__/utils/", + "/src/__tests__ignore/", "/dist/__tests__ignore/", ], }; \ No newline at end of file diff --git a/src/__tests__/dummy.ts b/src/__tests__/dummy.ts new file mode 100644 index 0000000..06f76d8 --- /dev/null +++ b/src/__tests__/dummy.ts @@ -0,0 +1,5 @@ +describe("dummy", () => { + it("should be true", () => { + expect(true).toBe(true); + }); +}); From 7dfccd7d61f34543a6a8dfdf02013a4035b3b1fb Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Wed, 20 Dec 2023 14:14:27 +0100 Subject: [PATCH 4/4] lint --- .eslintrc.js | 36 +++++++++---------- .../SQFSuperFluidStrategy.d.ts | 10 +++--- src/__live__/interaction.ts | 2 -- .../SQFSuperFluidStrategy.ts | 10 +++--- 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 306679b..8fb4c7f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,20 +1,16 @@ -module.exports = { - plugins: [ - "@typescript-eslint/eslint-plugin", - "eslint-plugin-tsdoc" - ], - extends: [ - 'plugin:@typescript-eslint/recommended' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: "./tsconfig.json", - tsconfigRootDir: __dirname, - ecmaVersion: 2018, - sourceType: "module" - }, - rules: { - "tsdoc/syntax": "warn", - "@typescript-eslint/no-explicit-any": "off", - } - }; \ No newline at end of file +module.exports = { + plugins: ["@typescript-eslint/eslint-plugin", "eslint-plugin-tsdoc"], + ignorePatterns: ["**/*ignore*/**"], + extends: ["plugin:@typescript-eslint/recommended"], + parser: "@typescript-eslint/parser", + parserOptions: { + project: "./tsconfig.json", + tsconfigRootDir: __dirname, + ecmaVersion: 2018, + sourceType: "module", + }, + rules: { + "tsdoc/syntax": "warn", + "@typescript-eslint/no-explicit-any": "off", + }, +}; diff --git a/dist/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.d.ts b/dist/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.d.ts index c9673cc..4163126 100644 --- a/dist/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.d.ts +++ b/dist/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.d.ts @@ -29,19 +29,19 @@ export declare class SQFSuperFluidStrategy { isPoolActive(): Promise; isValidAllocator(allocatorAddress: string): Promise; useRegistryAnchor(): Promise; - getInitialSuperAppBalance(): Promise; + getInitialSuperAppBalance(): Promise; getSuperfluidHost(): Promise<`0x${string}`>; getAllocationSuperToken(): Promise<`0x${string}`>; getPoolSuperToken(): Promise<`0x${string}`>; getGdaPool(): Promise<`0x${string}`>; getPassportDecoder(): Promise<`0x${string}`>; - getMinPassportScore(): Promise; + getMinPassportScore(): Promise; getMetadataRequired(): Promise; getRegistry(): Promise<`0x${string}`>; getRecipientIdBySuperApp(superApp: `0x${string}`): Promise<`0x${string}`>; - getRecipientAllocatorUnits(recipientId: `0x${string}`, allocator: `0x${string}`): Promise; - getTotalUnitsByRecipient(recipientId: `0x${string}`): Promise; - getRecipientFlowRate(recipientId: `0x${string}`): Promise; + getRecipientAllocatorUnits(recipientId: `0x${string}`, allocator: `0x${string}`): Promise; + getTotalUnitsByRecipient(recipientId: `0x${string}`): Promise; + getRecipientFlowRate(recipientId: `0x${string}`): Promise; getSuperApp(recipientId: `0x${string}`): Promise<`0x${string}`>; getUpdatePoolTimestampsData(registrationStartTime: bigint, registrationEndTime: bigint, allocationStartTime: bigint, allocationEndTime: bigint): TransactionData; getUpdateMinPassportScoreData(minPassportScore: bigint): TransactionData; diff --git a/src/__live__/interaction.ts b/src/__live__/interaction.ts index 5a5a47b..dc0f6da 100644 --- a/src/__live__/interaction.ts +++ b/src/__live__/interaction.ts @@ -1,5 +1,3 @@ -import { Registry } from "../Registry/Registry"; - import { createPublicClient, createWalletClient, http } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { goerli } from "viem/chains"; diff --git a/src/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.ts b/src/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.ts index 8f0e8fd..0413741 100644 --- a/src/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.ts +++ b/src/strategies/SuperFluidStrategy/SQFSuperFluidStrategy.ts @@ -268,7 +268,7 @@ export class SQFSuperFluidStrategy { return useRegistryAnchor; } - public getInitialSuperAppBalance(): Promise { + public getInitialSuperAppBalance(): Promise { this.checkStrategy(); return this.contract.read.initialSuperAppBalance(); @@ -304,7 +304,7 @@ export class SQFSuperFluidStrategy { return this.contract.read.passportDecoder(); } - public getMinPassportScore(): Promise { + public getMinPassportScore(): Promise { this.checkStrategy(); return this.contract.read.minPassportScore(); @@ -333,19 +333,19 @@ export class SQFSuperFluidStrategy { public getRecipientAllocatorUnits( recipientId: `0x${string}`, allocator: `0x${string}`, - ): Promise { + ): Promise { this.checkStrategy(); return this.contract.read.recipientAllocatorUnits([recipientId, allocator]); } - public getTotalUnitsByRecipient(recipientId: `0x${string}`): Promise { + public getTotalUnitsByRecipient(recipientId: `0x${string}`): Promise { this.checkStrategy(); return this.contract.read.totalUnitsByRecipient([recipientId]); } - public getRecipientFlowRate(recipientId: `0x${string}`): Promise { + public getRecipientFlowRate(recipientId: `0x${string}`): Promise { this.checkStrategy(); return this.contract.read.recipientFlowRate([recipientId]);