Skip to content

Commit

Permalink
feat: protocol provider base (#12)
Browse files Browse the repository at this point in the history
# 🤖 Linear

Closes GRT-49 GRT-50

## Description
- Implement Base Class for Protocol provider
- Implement getCurrentEpoch()
  • Loading branch information
0xkenj1 authored Jul 29, 2024
1 parent faffdfd commit c2dc309
Show file tree
Hide file tree
Showing 19 changed files with 2,252 additions and 24 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@ianvs/prettier-plugin-sort-imports": "4.3.1",
"@types/node": "20.14.12",
"@typescript-eslint/eslint-plugin": "7.16.1",
"@typescript-eslint/parser": "7.16.1",
"@vitest/coverage-v8": "^2.0.3",
Expand All @@ -30,6 +31,7 @@
"lint-staged": "15.2.7",
"prettier": "3.3.3",
"turbo": "2.0.7",
"ts-node": "10.9.2",
"typescript": "5.5.3",
"vitest": "2.0.3"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/automated-dispute/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated files
node_modules
dist
22 changes: 22 additions & 0 deletions packages/automated-dispute/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@ebo-agent/automated-dispute",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"lint": "eslint .",
"lint:fix": "pnpm lint --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"test": "vitest run",
"coverage": "vitest run --coverage"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"viem": "2.17.11"
}
}
355 changes: 355 additions & 0 deletions packages/automated-dispute/src/abis/epochManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
export const epochManagerAbi = [
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "nameHash",
type: "bytes32",
},
{
indexed: false,
internalType: "address",
name: "contractAddress",
type: "address",
},
],
name: "ContractSynced",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "epoch",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "epochLength",
type: "uint256",
},
],
name: "EpochLengthUpdate",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "epoch",
type: "uint256",
},
{
indexed: false,
internalType: "address",
name: "caller",
type: "address",
},
],
name: "EpochRun",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "string",
name: "param",
type: "string",
},
],
name: "ParameterUpdated",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "controller",
type: "address",
},
],
name: "SetController",
type: "event",
},
{
inputs: [
{
internalType: "contract IGraphProxy",
name: "_proxy",
type: "address",
},
],
name: "acceptProxy",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract IGraphProxy",
name: "_proxy",
type: "address",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "acceptProxyAndCall",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_block",
type: "uint256",
},
],
name: "blockHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "blockNum",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "controller",
outputs: [
{
internalType: "contract IController",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "currentEpoch",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "currentEpochBlock",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "currentEpochBlockSinceStart",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "epochLength",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_epoch",
type: "uint256",
},
],
name: "epochsSince",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "epochsSinceUpdate",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_controller",
type: "address",
},
{
internalType: "uint256",
name: "_epochLength",
type: "uint256",
},
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "isCurrentEpochRun",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "lastLengthUpdateBlock",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "lastLengthUpdateEpoch",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "lastRunEpoch",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "runEpoch",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_controller",
type: "address",
},
],
name: "setController",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_epochLength",
type: "uint256",
},
],
name: "setEpochLength",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "syncAllContracts",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
Loading

0 comments on commit c2dc309

Please sign in to comment.