Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new chains #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ PROVIDER_42161= ""
PROVIDER_1101= ""
#Base
PROVIDER_8453= ""
#Mantle
PROVIDER_5000= ""
#Immutable zkEVM
PROVIDER_13371= ""
#Manta
PROVIDER_169= ""
#Blast
PROVIDER_81457= ""
#Mode
PROVIDER_34443= ""

#Github auth token (used to generate a gist for diff tables)
KEEPER_GITHUB_AUTH_TOKEN= ""
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ yarn bot watch --chain <chainId> --time <timeIntervalInSeconds>
You can also run the bot once to try to dispute the latest block or check the bot against a previous block:

```bash
yarn bot run --chain <chainId>
yarn bot run --chain <chainId> --block <blockNumber>
yarn bot:hot run -c 81457
```

### Compare two points in time
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"publish-image": "chmod +x ./scripts/publish.sh && ./scripts/publish.sh"
},
"dependencies": {
"@angleprotocol/sdk": "0.26.14",
"@angleprotocol/sdk": "0.36.13",
"@google-cloud/secret-manager": "^4.2.2",
"@octokit/rest": "19.0.13",
"@types/chai": "^4.3.6",
Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
account=$1
version=$2

chainKeys=("polygon" "ethereum" "optimism" "arbitrum" "zkevm" "base" "gnosis" "thundercore" "core")
chainValues=(137 1 10 42161 1101 8453 100 108 1116)
chainKeys=("polygon" "ethereum" "optimism" "arbitrum" "zkevm" "base" "gnosis" "thundercore" "core" "manta" "immutable-zkevm" "mantle" "blast" "mode")
chainValues=(137 1 10 42161 1101 8453 100 108 1116 169 13371 5000 81457 34443)

for ((i=0; i<${#chainKeys[@]}; i++))
do
Expand Down
25 changes: 25 additions & 0 deletions scripts/templates/cloudrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@ spec:
secretKeyRef:
key: latest
name: KEEPER_GITHUB_AUTH_TOKEN
- name: PROVIDER_169
valueFrom:
secretKeyRef:
key: latest
name: PROVIDER_169
- name: PROVIDER_5000
valueFrom:
secretKeyRef:
key: latest
name: PROVIDER_5000
- name: PROVIDER_13371
valueFrom:
secretKeyRef:
key: latest
name: PROVIDER_13371
- name: PROVIDER_8147
valueFrom:
secretKeyRef:
key: latest
name: PROVIDER_81457
- name: PROVIDER_34443
valueFrom:
secretKeyRef:
key: latest
name: PROVIDER_34443
image: CHANGE_ME # spec.template.spec.containers.image
ports:
- containerPort: '5002'
Expand Down
10 changes: 5 additions & 5 deletions src/providers/on-chain/OnChainProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AMM } from '@angleprotocol/sdk';
import { ExtensiveDistributionParametersStructOutput } from '@angleprotocol/sdk/dist/generated/DistributionCreator';
import { DistributionParametersStructOutput } from '@angleprotocol/sdk/dist/generated/DistributionCreator';
import { BigNumber, ContractReceipt, Overrides, Wallet } from 'ethers';

import { HolderClaims, HolderDetail } from '../../types/holders';
Expand Down Expand Up @@ -27,8 +27,8 @@ export default abstract class OnChainProvider extends ExponentialBackoffProvider

protected abstract onChainParams: () => Promise<OnChainParams>;
protected abstract timestampAt: (blockNumber: number) => Promise<number>;
protected abstract activeDistributions: () => Promise<ExtensiveDistributionParametersStructOutput[]>;
protected abstract activeDistributionsBetween: (start: number, end: number) => Promise<ExtensiveDistributionParametersStructOutput[]>;
protected abstract activeDistributions: () => Promise<DistributionParametersStructOutput[]>;
protected abstract activeDistributionsBetween: (start: number, end: number) => Promise<DistributionParametersStructOutput[]>;
protected abstract poolName: (pool: string, amm: AMM) => Promise<string>;
protected abstract claimed: (holderDetails: HolderDetail[]) => Promise<HolderClaims>;
protected abstract approve: (
Expand Down Expand Up @@ -70,11 +70,11 @@ export default abstract class OnChainProvider extends ExponentialBackoffProvider
return this.retryWithExponentialBackoff(this.approval, this.fetchParams, address, token);
}

async fetchActiveDistributions(): Promise<ExtensiveDistributionParametersStructOutput[]> {
async fetchActiveDistributions(): Promise<DistributionParametersStructOutput[]> {
return this.retryWithExponentialBackoff(this.activeDistributions, this.fetchParams);
}

async fetchActiveDistributionsBetween(start: number, end: number): Promise<ExtensiveDistributionParametersStructOutput[]> {
async fetchActiveDistributionsBetween(start: number, end: number): Promise<DistributionParametersStructOutput[]> {
return this.retryWithExponentialBackoff(this.activeDistributionsBetween, this.fetchParams, start, end);
}

Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@angleprotocol/sdk@0.26.14":
version "0.26.14"
resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/0.26.14/06a1915797f3351011bf510ea3847aafb0183f06#06a1915797f3351011bf510ea3847aafb0183f06"
integrity sha512-amfvdAj6JM7RA0egpkZ3HhVF+7pJA68Z4UARGFwdRpBu6fQXd+JSHYGE0PqquxU5ujyp4+JdRHeOtdg6RVJ23Q==
"@angleprotocol/sdk@0.36.13":
version "0.36.13"
resolved "https://npm.pkg.github.com/download/@angleprotocol/sdk/0.36.13/f72f660a2c8c16d0899336ffe2b31b849f6031d8#f72f660a2c8c16d0899336ffe2b31b849f6031d8"
integrity sha512-PUIrwgmi74J9NgGnrE74BrhYJSI5ytTU6zX3Umc9+4fRr/wTsELKnOrIi1Eyqzfg6wRgoZXRUp649I8Tj6CjgA==
dependencies:
"@apollo/client" "^3.7.17"
"@typechain/ethers-v5" "^10.0.0"
Expand All @@ -23,7 +23,7 @@
lodash "^4.17.21"
merkletreejs "^0.3.10"
tiny-invariant "^1.1.0"
typechain "^8.0.0"
typechain "^8.3.2"

"@apollo/client@^3.7.17":
version "3.8.9"
Expand Down Expand Up @@ -3772,7 +3772,7 @@ type-is@~1.6.18:
media-typer "0.3.0"
mime-types "~2.1.24"

typechain@^8.0.0:
typechain@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73"
integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==
Expand Down
Loading