Skip to content

Commit

Permalink
Merge pull request #333 from curvefi/fix/fixed-updateFeeDataForRewards
Browse files Browse the repository at this point in the history
fix: fixed updateFeeData for claimCrv and claimRewards
  • Loading branch information
amytsang authored May 8, 2024
2 parents 7b40d7e + 9075488 commit b1938c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.58.4",
"version": "2.58.5",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
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 b1938c9

Please sign in to comment.