Skip to content

Commit

Permalink
fix: gas limits
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem committed Jan 3, 2024
1 parent 81a235b commit 26b82bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/contract-helpers/src/commons/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export enum ProtocolAction {
setUsageAsCollateral = 'setUsageAsCollateral',
withdrawAndSwitch = 'withdrawAndSwitch',
batchMetaDelegate = 'batchMetaDelegate',
updateRepresentatives = 'updateRepresentatives',
}

export enum GovernanceVote {
Expand Down
4 changes: 4 additions & 0 deletions packages/contract-helpers/src/commons/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export const gasLimitRecommendations: GasRecommendationType = {
limit: '200000',
recommended: '200000',
},
[ProtocolAction.updateRepresentatives]: {
limit: '60000',
recommended: '60000',
},
};

export const mintAmountsPerToken: Record<string, string> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ChainId } from 'contract-helpers/src/commons/types';
import { ChainId, ProtocolAction } from 'contract-helpers/src/commons/types';
import { gasLimitRecommendations } from 'contract-helpers/src/commons/utils';
import { BigNumber, PopulatedTransaction, providers } from 'ethers';
import {
GovernanceCore,
Expand Down Expand Up @@ -44,7 +45,9 @@ export class GovernanceCoreService implements GovernanceCoreServiceInterface {
),
to: this._contractInstance.address,
from: user,
gasLimit: BigNumber.from('1000000'),
gasLimit: BigNumber.from(
gasLimitRecommendations[ProtocolAction.updateRepresentatives].limit,
),
};

return actionTx;
Expand Down

0 comments on commit 26b82bf

Please sign in to comment.