Skip to content

Commit

Permalink
fix stuff (#42)
Browse files Browse the repository at this point in the history
* start on direct grants

* updates on direct

* smol updates

* fix types in wrong file

* fix types

* clean up

* clean up

* adds hardhat

* adding hardhat tests

* layout some tests

* remove unused files

* update action

* work on tests

* remove legacy test files

* fix package

* wip

* add random to profile creation nonce

* updated with viem/tests still work 😵‍💫

* version bump

* exported direct grants

* fix init data

* fix type

---------

Co-authored-by: Jaxcoder <[email protected]>
  • Loading branch information
0xKurt and codenamejason authored Feb 26, 2024
1 parent ab58cdc commit ff5f470
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/strategies/DirectGrants/DirectGrantsStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class DirectGrantsStrategy {
}
getRegisterRecipientData(data) {
this.checkPoolId();
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uit256, string)"), [
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uint256, string)"), [
data.registryAnchor || types_1.ZERO_ADDRESS,
data.recipientAddress,
data.grantAmount,
Expand All @@ -332,7 +332,7 @@ class DirectGrantsStrategy {
this.checkPoolId();
const encodedParams = [];
data.forEach((registerData) => {
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uit256, string)"), [
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uint256, string)"), [
registerData.registryAnchor || types_1.ZERO_ADDRESS,
registerData.recipientAddress,
registerData.grantAmount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class DonationVotingMerkleDistributionStrategy {
this.checkPoolId();
const encodedParams = [];
data.forEach((registerData) => {
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, (uit256, string)"), [
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, (uint256, string)"), [
registerData.registryAnchor || types_1.ZERO_ADDRESS,
registerData.recipientAddress,
[registerData.metadata.protocol, registerData.metadata.pointer],
Expand Down
2 changes: 1 addition & 1 deletion dist/strategies/MicroGrantsStrategy/MicroGrantsStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class MicroGrantsStrategy {
this.checkPoolId();
const encodedParams = [];
data.forEach((registerData) => {
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uit256, string)"), [
const encoded = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, address, uint256, (uint256, string)"), [
registerData.registryAnchor || types_1.ZERO_ADDRESS,
registerData.recipientAddress,
registerData.requestedAmount,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@allo-team/allo-v2-sdk",
"version": "1.0.50",
"version": "1.0.51",
"description": "sdk for allo v2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 5 additions & 4 deletions src/strategies/DirectGrants/DirectGrantsStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,14 @@ export class DirectGrantsStrategy {
public getRegisterRecipientData(data: RegisterData): TransactionData {
this.checkPoolId();
const encoded: `0x${string}` = encodeAbiParameters(
parseAbiParameters("address, address, uint256, (uit256, string)"),
parseAbiParameters("address, address, uint256, (uint256, string)"),
[
data.registryAnchor || ZERO_ADDRESS,
data.recipientAddress,
data.grantAmount,
[data.metadata.protocol, data.metadata.pointer],
]

],
);

const encodedData = encodeFunctionData({
Expand All @@ -455,13 +456,13 @@ export class DirectGrantsStrategy {

data.forEach((registerData) => {
const encoded: `0x${string}` = encodeAbiParameters(
parseAbiParameters("address, address, uint256, (uit256, string)"),
parseAbiParameters("address, address, uint256, (uint256, string)"),
[
registerData.registryAnchor || ZERO_ADDRESS,
registerData.recipientAddress,
registerData.grantAmount,
[registerData.metadata.protocol, registerData.metadata.pointer],
]
],
);

encodedParams.push(encoded);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export class DonationVotingMerkleDistributionStrategy {

data.forEach((registerData) => {
const encoded: `0x${string}` = encodeAbiParameters(
parseAbiParameters("address, address, (uit256, string)"),
parseAbiParameters("address, address, (uint256, string)"),
[
registerData.registryAnchor || ZERO_ADDRESS,
registerData.recipientAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/strategies/MicroGrantsStrategy/MicroGrantsStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ export class MicroGrantsStrategy {

data.forEach((registerData) => {
const encoded: `0x${string}` = encodeAbiParameters(
parseAbiParameters("address, address, uint256, (uit256, string)"),
parseAbiParameters("address, address, uint256, (uint256, string)"),
[
registerData.registryAnchor || ZERO_ADDRESS,
registerData.recipientAddress,
Expand Down

0 comments on commit ff5f470

Please sign in to comment.