Skip to content

Commit

Permalink
Bump gas limit for token validator
Browse files Browse the repository at this point in the history
  • Loading branch information
willpote committed Feb 17, 2022
1 parent b19ebcb commit c01f48a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/providers/token-validator-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface TokenValidationResults {

const TOKEN_VALIDATOR_ADDRESS = '0xb5ee1690b7dcc7859771148d0889be838fe108e0';
const AMOUNT_TO_FLASH_BORROW = '1000';
const GAS_LIMIT_PER_VALIDATE = 300_000;
const GAS_LIMIT_PER_VALIDATE = 1_000_000;

/**
* Provider for getting token data.
Expand Down Expand Up @@ -50,7 +50,9 @@ export class TokenValidatorProvider implements ITokenValidatorProvider {
protected chainId: ChainId,
protected multicall2Provider: IMulticallProvider,
private tokenValidationCache: ICache<TokenValidationResult>,
private tokenValidatorAddress = TOKEN_VALIDATOR_ADDRESS
private tokenValidatorAddress = TOKEN_VALIDATOR_ADDRESS,
private gasLimitPerCall = GAS_LIMIT_PER_VALIDATE,
private amountToFlashBorrow = AMOUNT_TO_FLASH_BORROW
) {
this.BASES = [WRAPPED_NATIVE_CURRENCY[this.chainId]!.address];
}
Expand Down Expand Up @@ -91,7 +93,7 @@ export class TokenValidatorProvider implements ITokenValidatorProvider {
);

const functionParams = _(addresses)
.map((address) => [address, this.BASES, AMOUNT_TO_FLASH_BORROW])
.map((address) => [address, this.BASES, this.amountToFlashBorrow])
.value() as [string, string[], string][];

// We use the validate function instead of batchValidate to avoid poison pill problem.
Expand All @@ -107,7 +109,7 @@ export class TokenValidatorProvider implements ITokenValidatorProvider {
functionParams: functionParams,
providerConfig,
additionalConfig: {
gasLimitPerCallOverride: GAS_LIMIT_PER_VALIDATE,
gasLimitPerCallOverride: this.gasLimitPerCall,
},
});

Expand Down

0 comments on commit c01f48a

Please sign in to comment.