Skip to content

Commit

Permalink
Merge pull request #46 from dmccartney/daniel-fix-sweep-addr
Browse files Browse the repository at this point in the history
fix: check for array of addresses when prepping sweep
  • Loading branch information
dmccartney authored Jun 26, 2024
2 parents 47ad93c + 29bc873 commit eb30c42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/components/SafeSweepCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
estimateDistributeConsensusBatchGas,
estimateFinalizeGas,
estimateTipsMevGas,
firstOrOnly,
MinipoolStatus,
safeAppUrl,
} from "../utils";
Expand Down Expand Up @@ -499,7 +500,7 @@ function useSweeper({ nodeAddress }) {
txs = txs.concat([
{
operation: "0x00",
to: contracts.RocketMerkleDistributorMainnet.address,
to: firstOrOnly(contracts.RocketMerkleDistributorMainnet.address),
value: "0",
data: new ethers.utils.Interface(
contracts.RocketMerkleDistributorMainnet.abi
Expand Down
4 changes: 4 additions & 0 deletions web/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ethers } from "ethers";
import _ from "lodash";

export function firstOrOnly(arrayOrNot) {
return Array.isArray(arrayOrNot) ? arrayOrNot[0] : arrayOrNot;
}

// Trim the input address to be "0x####...####"
export function shortenAddress(address, charCount = 4) {
// .getAddress here ensures we're dealing with the checksum address
Expand Down

0 comments on commit eb30c42

Please sign in to comment.