Skip to content

Commit

Permalink
fix: fixed updateFeeData for claimCrv and claimRewards
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorovdg committed May 8, 2024
1 parent c510ca6 commit 6e0a65b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pools/PoolTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ export class PoolTemplate {
if (this.rewardsOnly()) throw Error(`${this.name} has Rewards-Only Gauge. Use claimRewards instead`);
const contract = curve.chainId === 1 ? curve.contracts[curve.constants.ALIASES.minter].contract : curve.contracts[curve.constants.ALIASES.gauge_factory].contract;

await curve.updateFeeData();

const gasLimit = mulBy1_3(DIGas(await contract.mint.estimateGas(this.gauge, curve.constantOptions)));
return (await contract.mint(this.gauge, { ...curve.options, gasLimit })).hash;
}
Expand Down Expand Up @@ -1332,6 +1334,8 @@ export class PoolTemplate {
const gaugeContract = curve.contracts[this.gauge].contract;
if (!("claim_rewards()" in gaugeContract)) throw Error (`${this.name} pool doesn't have such method`);

await curve.updateFeeData();

const gasLimit = mulBy1_3(DIGas(await gaugeContract.claim_rewards.estimateGas(curve.constantOptions)));
return (await gaugeContract.claim_rewards({ ...curve.options, gasLimit })).hash;
}
Expand Down

0 comments on commit 6e0a65b

Please sign in to comment.