diff --git a/web/src/components/SafeSweepCard.js b/web/src/components/SafeSweepCard.js index 62046bd..106949c 100644 --- a/web/src/components/SafeSweepCard.js +++ b/web/src/components/SafeSweepCard.js @@ -41,6 +41,7 @@ import { estimateDistributeConsensusBatchGas, estimateFinalizeGas, estimateTipsMevGas, + firstOrOnly, MinipoolStatus, safeAppUrl, } from "../utils"; @@ -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 diff --git a/web/src/utils.js b/web/src/utils.js index eb9b940..4954877 100644 --- a/web/src/utils.js +++ b/web/src/utils.js @@ -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