Skip to content

Commit

Permalink
Fix mode
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed May 27, 2024
1 parent f5bebc0 commit 3637268
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/lib/harvest-actions/harvest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type HarvestParameters =
}
| {
strategyAddress: Hex;
transactionCostEstimationWei: null;
transactionCostEstimationWei: bigint | null;
transactionGasLimit: null;
};

Expand Down
4 changes: 3 additions & 1 deletion src/lib/harvest-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ export async function harvestChain({
await reportOnMultipleHarvestAsyncCall(stratsToBeHarvested, 'transaction', 'sequential', async item => {
let harvestParams: HarvestParameters = {
strategyAddress: item.vault.strategyAddress,
transactionCostEstimationWei: null,
// mode fails to estimate gas because their eth_estimateGas method doesn't accept fee params
// and removing those in view is near impossible
transactionCostEstimationWei: chain === 'mode' ? item.simulation.gas.transactionCostEstimationWei : null,
transactionGasLimit: null,
};

Expand Down
12 changes: 8 additions & 4 deletions src/lib/rpc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createPublicClient, createWalletClient } from 'viem';
import { type Chain } from './chain';
import { privateKeyToAccount } from 'viem/accounts';
import { RPC_CONFIG } from './config';
import { gnosis, linea, mantle, mode, type Chain as ViemChain } from 'viem/chains';
import { type Chain as ViemChain } from 'viem/chains';
import {
arbitrum,
aurora,
Expand All @@ -15,14 +15,18 @@ import {
fantom,
fraxtal,
fuse,
gnosis,
harmonyOne,
kava,
linea,
mainnet,
harmonyOne,
polygon,
mantle,
metis,
mode,
moonbeam,
moonriver,
metis,
optimism,
polygon,
polygonZkEvm,
scroll,
zkSync,
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2407,10 +2407,10 @@ isexe@^2.0.0:
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==

[email protected].3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74"
integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==
[email protected].4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.4.tgz#810cd0d90cc4995c26395d2aa4cfa4037ebdf061"
integrity sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==

istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
version "3.2.0"
Expand Down Expand Up @@ -4752,18 +4752,18 @@ validate-npm-package-name@^5.0.0:
dependencies:
builtins "^5.0.0"

viem@^2.10.1:
version "2.10.1"
resolved "https://registry.yarnpkg.com/viem/-/viem-2.10.1.tgz#0dffc8e4c7a03dd06de098931b3666b68a040964"
integrity sha512-sfbcFdzlMHSZI+4RpqidxOqPu6xwWtmqDBWSVml2XV+n21dgQFmVRN0nHhZoyMDSo4mTSKtWwW9sHHu9vUF2mw==
viem@^2.12.5:
version "2.12.5"
resolved "https://registry.yarnpkg.com/viem/-/viem-2.12.5.tgz#b30888367c193ca3ab1bc2864a9723ac3f10ba87"
integrity sha512-OHS+356v/ykkQMWEhefDRa5aC3iM3wEzdBlPoAhkCilsXRTAyy0YofYZ9hZG8SyM+0Ltl01j5EyJHqo0o62Czg==
dependencies:
"@adraffy/ens-normalize" "1.10.0"
"@noble/curves" "1.2.0"
"@noble/hashes" "1.3.2"
"@scure/bip32" "1.3.2"
"@scure/bip39" "1.2.1"
abitype "1.0.0"
isows "1.0.3"
isows "1.0.4"
ws "8.13.0"

walker@^1.0.8:
Expand Down

0 comments on commit 3637268

Please sign in to comment.