Skip to content

Commit

Permalink
fix lint/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv Chauhan authored and Dhruv Chauhan committed Aug 23, 2023
1 parent ad3364f commit 1fe671e
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 63 deletions.
2 changes: 1 addition & 1 deletion subgraphs/uniswap-forks-swap/src/common/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function getOrCreateToken(address: string): Token {
export function getOrCreateLPToken(
tokenAddress: string,
token0: Token,
token1: Token
token1: Token,
): Token {
let token = Token.load(tokenAddress);
// fetch info if null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class UniswapV2MainnetConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f")
Address.fromString("0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f"),
);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down Expand Up @@ -208,9 +208,7 @@ export class UniswapV2MainnetConfigurations implements Configurations {
];
}
getBrokenERC20Tokens(): string[] {
return [
"0x0000000000bF2686748E1C0255036e7617E7E8A5",
];
return ["0x0000000000bf2686748e1c0255036e7617e7e8a5"];
}
getMinimumLiquidityThresholdTrackVolume(): BigDecimal {
return MINIMUM_LIQUIDITY_FOUR_HUNDRED_THOUSAND;
Expand Down
28 changes: 14 additions & 14 deletions subgraphs/uniswap-forks/src/common/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function getLiquidityPool(poolAddress: string): LiquidityPool {
}

export function getLiquidityPoolAmounts(
poolAddress: string
poolAddress: string,
): _LiquidityPoolAmount {
return _LiquidityPoolAmount.load(poolAddress)!;
}
Expand All @@ -73,7 +73,7 @@ export function getLiquidityPoolFee(id: string): LiquidityPoolFee {
}

export function getOrCreateTokenWhitelist(
tokenAddress: string
tokenAddress: string,
): _TokenWhitelist {
let tokenTracker = _TokenWhitelist.load(tokenAddress);
// fetch info if null
Expand All @@ -99,7 +99,7 @@ export function getOrCreateTransfer(event: ethereum.Event): _Transfer {
}

export function getOrCreateUsageMetricDailySnapshot(
event: ethereum.Event
event: ethereum.Event,
): UsageMetricsDailySnapshot {
// Number of days since Unix epoch
const id = event.block.timestamp.toI32() / SECONDS_PER_DAY;
Expand Down Expand Up @@ -130,7 +130,7 @@ export function getOrCreateUsageMetricDailySnapshot(
return usageMetrics;
}
export function getOrCreateUsageMetricHourlySnapshot(
event: ethereum.Event
event: ethereum.Event,
): UsageMetricsHourlySnapshot {
// Number of days since Unix epoch
const hour = event.block.timestamp.toI32() / SECONDS_PER_HOUR;
Expand Down Expand Up @@ -160,17 +160,17 @@ export function getOrCreateUsageMetricHourlySnapshot(
}

export function getOrCreateLiquidityPoolDailySnapshot(
event: ethereum.Event
event: ethereum.Event,
): LiquidityPoolDailySnapshot {
const day = event.block.timestamp.toI32() / SECONDS_PER_DAY;
const dayId = day.toString();
let poolMetrics = LiquidityPoolDailySnapshot.load(
event.address.toHexString().concat("-").concat(dayId)
event.address.toHexString().concat("-").concat(dayId),
);

if (!poolMetrics) {
poolMetrics = new LiquidityPoolDailySnapshot(
event.address.toHexString().concat("-").concat(dayId)
event.address.toHexString().concat("-").concat(dayId),
);
poolMetrics.protocol = NetworkConfigs.getFactoryAddress();
poolMetrics.pool = event.address.toHexString();
Expand Down Expand Up @@ -198,18 +198,18 @@ export function getOrCreateLiquidityPoolDailySnapshot(
}

export function getOrCreateLiquidityPoolHourlySnapshot(
event: ethereum.Event
event: ethereum.Event,
): LiquidityPoolHourlySnapshot {
const hour = event.block.timestamp.toI32() / SECONDS_PER_HOUR;

const hourId = hour.toString();
let poolMetrics = LiquidityPoolHourlySnapshot.load(
event.address.toHexString().concat("-").concat(hourId)
event.address.toHexString().concat("-").concat(hourId),
);

if (!poolMetrics) {
poolMetrics = new LiquidityPoolHourlySnapshot(
event.address.toHexString().concat("-").concat(hourId)
event.address.toHexString().concat("-").concat(hourId),
);
poolMetrics.protocol = NetworkConfigs.getFactoryAddress();
poolMetrics.pool = event.address.toHexString();
Expand Down Expand Up @@ -237,7 +237,7 @@ export function getOrCreateLiquidityPoolHourlySnapshot(
}

export function getOrCreateFinancialsDailySnapshot(
event: ethereum.Event
event: ethereum.Event,
): FinancialsDailySnapshot {
// Number of days since Unix epoch
const dayID = event.block.timestamp.toI32() / SECONDS_PER_DAY;
Expand Down Expand Up @@ -271,7 +271,7 @@ export function getOrCreateFinancialsDailySnapshot(
export function getOrCreateToken(
event: ethereum.Event,
address: string,
getNewPrice: boolean = true
getNewPrice: boolean = true,
): Token {
let token = Token.load(address);
if (!token) {
Expand Down Expand Up @@ -322,7 +322,7 @@ export function getOrCreateToken(
export function getOrCreateLPToken(
tokenAddress: string,
token0: Token,
token1: Token
token1: Token,
): Token {
let token = Token.load(tokenAddress);
// fetch info if null
Expand All @@ -344,7 +344,7 @@ export function getOrCreateLPToken(

export function getOrCreateRewardToken(
event: ethereum.Event,
address: string
address: string,
): RewardToken {
let rewardToken = RewardToken.load(address);
if (rewardToken == null) {
Expand Down
10 changes: 5 additions & 5 deletions subgraphs/uniswap-v3-forks-swap/src/common/entities/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function getOrCreateToken(address: Bytes): Token {
if (
token.id ==
Address.fromHexString(
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1".toLowerCase()
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1".toLowerCase(),
) &&
NetworkConfigs.getNetwork() == Network.ARBITRUM_ONE
) {
Expand Down Expand Up @@ -67,7 +67,7 @@ export function getOrCreateToken(address: Bytes): Token {
export function getOrCreateLPToken(
tokenAddress: Bytes,
token0: Token,
token1: Token
token1: Token,
): Token {
let token = Token.load(tokenAddress);
// fetch info if null
Expand All @@ -86,7 +86,7 @@ function fixTokenFields(token: Token): Token {
if (
token.id ==
Address.fromHexString(
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1".toLowerCase()
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1".toLowerCase(),
) &&
NetworkConfigs.getNetwork() == Network.ARBITRUM_ONE
) {
Expand All @@ -98,7 +98,7 @@ function fixTokenFields(token: Token): Token {
if (
token.id ==
Address.fromHexString(
"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8".toLowerCase()
"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8".toLowerCase(),
) &&
NetworkConfigs.getNetwork() == Network.ARBITRUM_ONE
) {
Expand All @@ -109,7 +109,7 @@ function fixTokenFields(token: Token): Token {
if (
token.id ==
Address.fromHexString(
"0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9".toLowerCase()
"0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9".toLowerCase(),
) &&
NetworkConfigs.getNetwork() == Network.ARBITRUM_ONE
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Factory } from "../../../../../generated/Factory/Factory";
import {
BIGDECIMAL_TEN_THOUSAND,
FeeSwitch,
INT_FIVE_HUNDRED,
INT_HUNDRED,
Network,
RewardIntervalType,
} from "../../../../../src/common/constants";
Expand All @@ -25,16 +27,16 @@ export class PancakeV3BSCConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865")
Address.fromString("0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"),
);
}
getProtocolFeeOnOff(): string {
return FeeSwitch.ON;
}
getInitialProtocolFeeProportion(fee: i64): BigDecimal {
if (fee == 100) {
if (fee == INT_HUNDRED) {
return BigDecimal.fromString("0.33");
} else if (fee == 500) {
} else if (fee == INT_FIVE_HUNDRED) {
return BigDecimal.fromString("0.34");
}
return BigDecimal.fromString("0.32");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Factory } from "../../../../../generated/Factory/Factory";
import {
BIGDECIMAL_TEN_THOUSAND,
FeeSwitch,
INT_FIVE_HUNDRED,
INT_HUNDRED,
Network,
RewardIntervalType,
} from "../../../../../src/common/constants";
Expand All @@ -25,16 +27,16 @@ export class PancakeV3EthereumConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865")
Address.fromString("0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"),
);
}
getProtocolFeeOnOff(): string {
return FeeSwitch.ON;
}
getInitialProtocolFeeProportion(fee: i64): BigDecimal {
if (fee == 100) {
if (fee == INT_HUNDRED) {
return BigDecimal.fromString("0.33");
} else if (fee == 500) {
} else if (fee == INT_FIVE_HUNDRED) {
return BigDecimal.fromString("0.34");
}
return BigDecimal.fromString("0.32");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3ArbitrumConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x1af415a1eba07a4986a52b6f2e7de7003d82231e")
Address.fromString("0x1af415a1eba07a4986a52b6f2e7de7003d82231e"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3AvalancheConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x3e603c14af37ebdad31709c4f848fc6ad5bec715")
Address.fromString("0x3e603c14af37ebdad31709c4f848fc6ad5bec715"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3BscConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x126555dd55a39328f69400d6ae4f782bd4c34abb")
Address.fromString("0x126555dd55a39328f69400d6ae4f782bd4c34abb"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3EthereumConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0xbaceb8ec6b9355dfc0269c18bac9d6e2bdc29c4f")
Address.fromString("0xbaceb8ec6b9355dfc0269c18bac9d6e2bdc29c4f"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3FantomConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x7770978eed668a3ba661d51a773d3a992fc9ddcb")
Address.fromString("0x7770978eed668a3ba661d51a773d3a992fc9ddcb"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3FuseConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x1b9d177ccdea3c79b6c8f40761fc8dc9d0500eaa")
Address.fromString("0x1b9d177ccdea3c79b6c8f40761fc8dc9d0500eaa"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3GnosisConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0xf78031cbca409f2fb6876bdfdbc1b2df24cf9bef")
Address.fromString("0xf78031cbca409f2fb6876bdfdbc1b2df24cf9bef"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3MoonriverConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x2f255d3f3c0a3726c6c99e74566c4b18e36e3ce6")
Address.fromString("0x2f255d3f3c0a3726c6c99e74566c4b18e36e3ce6"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3OptimismConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x9c6522117e2ed1fe5bdb72bb0ed5e3f2bde7dbe0")
Address.fromString("0x9c6522117e2ed1fe5bdb72bb0ed5e3f2bde7dbe0"),
);
}
getProtocolFeeOnOff(): string {
Expand Down Expand Up @@ -63,7 +63,7 @@ export class SushiswapV3OptimismConfigurations implements Configurations {
"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", // USDT
"0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", // DAI
"0x7170bd6f5ab1ac44a1ba7a0beb5f3f06c2d4a898", // SUSD
"0x3eaEb77b03dBc0F6321AE1b72b2E9aDb0F60112B", // SUSHI
"0x3eaeb77b03dbc0f6321ae1b72b2e9adb0f60112b", // SUSHI
]);
}
getStableCoins(): Bytes[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SushiswapV3PolygonConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x917933899c6a5f8e37f31e19f92cdbff7e8ff0e2")
Address.fromString("0x917933899c6a5f8e37f31e19f92cdbff7e8ff0e2"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UniswapV3ArbitrumConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x1f98431c8ad98523631ae4a59f267346ea31f984")
Address.fromString("0x1f98431c8ad98523631ae4a59f267346ea31f984"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UniswapV3BaseConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x33128a8fc17869897dce68ed026d694621f6fdfd")
Address.fromString("0x33128a8fc17869897dce68ed026d694621f6fdfd"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UniswapV3BSCConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7")
Address.fromString("0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UniswapV3CeloConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0xd9dc0d8f754c027df7ecb4bd381301cec76cd32f")
Address.fromString("0xd9dc0d8f754c027df7ecb4bd381301cec76cd32f"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UniswapV3MainnetConfigurations implements Configurations {
}
getFactoryContract(): Factory {
return Factory.bind(
Address.fromString("0x1f98431c8ad98523631ae4a59f267346ea31f984")
Address.fromString("0x1f98431c8ad98523631ae4a59f267346ea31f984"),
);
}
getProtocolFeeOnOff(): string {
Expand Down
Loading

0 comments on commit 1fe671e

Please sign in to comment.