Skip to content

Commit

Permalink
feat: disable Polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Jan 18, 2024
1 parent 10e255b commit b3cba6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/bot/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import DiscordWebhookLogger from '../helpers/logger/DiscordWebhookLogger';
import Logger from '../helpers/logger/Logger';
import Loggers from '../helpers/logger/Loggers';
import GithubRootsProvider from '../providers/merkl-roots/GithubRootsProvider';
import GoogleRootsProvider from '../providers/merkl-roots/GoogleRootsProvider';
import MerkleRootsProvider from '../providers/merkl-roots/MerkleRootsProvider';
import OnChainProvider from '../providers/on-chain/OnChainProvider';
import RpcProvider from '../providers/on-chain/RpcProvider';
import GoogleRootsProvider from '../providers/merkl-roots/GoogleRootsProvider';

export interface DisputeContext {
chainId: ChainId;
Expand Down Expand Up @@ -40,7 +40,7 @@ export const defaultContext = (chainId: number, blockNumber?: number): DisputeCo
chainId,
blockNumber,
onChainProvider,
merkleRootsProvider: new GoogleRootsProvider('https://storage.googleapis.com/merkl-production-rewards', chainId),
merkleRootsProvider: new GithubRootsProvider('https://raw.githubusercontent.com/AngleProtocol/merkl-rewards/main/', chainId),
logger: new Loggers(loggers),
uploadDiffTable: true,
};
Expand Down
13 changes: 8 additions & 5 deletions src/bot/dispute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export const approveDisputeStake: Step = async ({ onChainProvider, chainId }, re
}
: {};

const approveReceipt = await onChainProvider.sendApproveTxn(signer, disputeToken, disputeAmount, txnOverrides);

let approveReceipt;
if (chainId !== ChainId.POLYGON) {
approveReceipt = await onChainProvider.sendApproveTxn(signer, disputeToken, disputeAmount, txnOverrides);
}
return Result.Success({ ...report, disputeReport: { ...report.disputeReport, approveReceipt } });
} catch (err) {
return Result.Error({
Expand All @@ -49,7 +51,6 @@ export const approveDisputeStake: Step = async ({ onChainProvider, chainId }, re
export const disputeTree: Step = async ({ onChainProvider, chainId }, report) => {
try {
const { signer } = report?.disputeReport;

const txnOverrides =
chainId === ChainId.POLYGON
? {
Expand All @@ -58,8 +59,10 @@ export const disputeTree: Step = async ({ onChainProvider, chainId }, report) =>
}
: {};

const disputeReceipt = await onChainProvider.sendDisputeTxn(signer, 'Dispute detected', txnOverrides);

let disputeReceipt;
if (chainId !== ChainId.POLYGON) {
disputeReceipt = await onChainProvider.sendDisputeTxn(signer, 'Dispute detected', txnOverrides);
}
return Result.Success({ ...report, disputeReport: { ...report.disputeReport, disputeReceipt } });
} catch (err) {
return Result.Error({
Expand Down

0 comments on commit b3cba6f

Please sign in to comment.