Skip to content

Commit

Permalink
Use Library for Multisend (#20)
Browse files Browse the repository at this point in the history
In order to have less, overall, logic in this project, we use an npm library `ethers-multisend`. The reason we hesitated before was because it uses ethers-v5, but it does not really affect our flow (just adds a few more node modules).
  • Loading branch information
cowanator committed Jun 17, 2024
1 parent dbb2802 commit fc1b790
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 69 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@slack/web-api": "^7.1.0",
"@types/node": "^20.11.30",
"ethers": "^6.12.0",
"ethers-multisend": "^3.1.0",
"loglevel": "^1.9.1",
"moment": "^2.30.1",
"typescript": "^5.4.3",
Expand Down
6 changes: 3 additions & 3 deletions src/billingContract.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ethers, formatEther } from "ethers";
import { BillingData, LatestBillingStatus, PaymentStatus } from "./types";
import { BILLING_CONTRACT_ABI, ROLE_MODIFIER_ABI } from "./abis";
import { MetaTransaction, encodeMulti } from "./multisend";
import { getTxCostForGas, maxBigInt } from "./gas";
import { MetaTransaction, encodeMulti } from "ethers-multisend";

interface BillingInput {
addresses: `0x${string}`[];
Expand Down Expand Up @@ -151,7 +151,7 @@ export class BillingContract {
account,
amount,
]),
value: 0,
value: "0",
operation: 0,
};
}
Expand Down Expand Up @@ -187,7 +187,7 @@ export class BillingContract {
amount,
feeRecipient,
]),
value: 0,
value: "0",
operation: 0,
};
}
Expand Down
64 changes: 0 additions & 64 deletions src/multisend.ts

This file was deleted.

Loading

0 comments on commit fc1b790

Please sign in to comment.