Skip to content

Commit 813151e

Browse files
authored
Add SubgraphAvailabilityManager graph (graphprotocol#1)
1 parent e53a031 commit 813151e

13 files changed

+4493
-0
lines changed

.github/workflows/tests.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
# Install commands
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '20'
20+
registry-url: https://registry.npmjs.org
21+
- name: yarn add ts-node
22+
run: yarn add ts-node
23+
- name: yarn install
24+
run: yarn install
25+
26+
# Run scripts
27+
- name: Test
28+
run: yarn test

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ignore truffle stuff
2+
build/
3+
4+
subgraph.yaml
5+
generated/
6+
node_modules/
7+
src/types/
8+
src/mappings/helpers/metadata.ts
9+
.DS_STORE
10+
yarn-error.log
11+
subgraph.yaml
12+
config/addresses.ts
13+
config/generatedAddresses.json
14+
tests/.bin
15+
.vscode
16+
.latest.json

abis/SubgraphAvailabilityManager.json

+276
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
[
2+
{
3+
"inputs": [
4+
{ "internalType": "address", "name": "_governor", "type": "address" },
5+
{
6+
"internalType": "address",
7+
"name": "_rewardsManager",
8+
"type": "address"
9+
},
10+
{
11+
"internalType": "uint256",
12+
"name": "_executionThreshold",
13+
"type": "uint256"
14+
},
15+
{
16+
"internalType": "uint256",
17+
"name": "_voteTimeLimit",
18+
"type": "uint256"
19+
},
20+
{ "internalType": "address[5]", "name": "_oracles", "type": "address[5]" }
21+
],
22+
"stateMutability": "nonpayable",
23+
"type": "constructor"
24+
},
25+
{
26+
"anonymous": false,
27+
"inputs": [
28+
{
29+
"indexed": true,
30+
"internalType": "address",
31+
"name": "from",
32+
"type": "address"
33+
},
34+
{
35+
"indexed": true,
36+
"internalType": "address",
37+
"name": "to",
38+
"type": "address"
39+
}
40+
],
41+
"name": "NewOwnership",
42+
"type": "event"
43+
},
44+
{
45+
"anonymous": false,
46+
"inputs": [
47+
{
48+
"indexed": true,
49+
"internalType": "address",
50+
"name": "from",
51+
"type": "address"
52+
},
53+
{
54+
"indexed": true,
55+
"internalType": "address",
56+
"name": "to",
57+
"type": "address"
58+
}
59+
],
60+
"name": "NewPendingOwnership",
61+
"type": "event"
62+
},
63+
{
64+
"anonymous": false,
65+
"inputs": [
66+
{
67+
"indexed": true,
68+
"internalType": "uint256",
69+
"name": "index",
70+
"type": "uint256"
71+
},
72+
{
73+
"indexed": true,
74+
"internalType": "address",
75+
"name": "oracle",
76+
"type": "address"
77+
}
78+
],
79+
"name": "OracleSet",
80+
"type": "event"
81+
},
82+
{
83+
"anonymous": false,
84+
"inputs": [
85+
{
86+
"indexed": true,
87+
"internalType": "bytes32",
88+
"name": "subgraphDeploymentID",
89+
"type": "bytes32"
90+
},
91+
{
92+
"indexed": false,
93+
"internalType": "bool",
94+
"name": "deny",
95+
"type": "bool"
96+
},
97+
{
98+
"indexed": true,
99+
"internalType": "uint256",
100+
"name": "oracleIndex",
101+
"type": "uint256"
102+
},
103+
{
104+
"indexed": false,
105+
"internalType": "uint256",
106+
"name": "timestamp",
107+
"type": "uint256"
108+
}
109+
],
110+
"name": "OracleVote",
111+
"type": "event"
112+
},
113+
{
114+
"anonymous": false,
115+
"inputs": [
116+
{
117+
"indexed": false,
118+
"internalType": "uint256",
119+
"name": "voteTimeLimit",
120+
"type": "uint256"
121+
}
122+
],
123+
"name": "VoteTimeLimitSet",
124+
"type": "event"
125+
},
126+
{
127+
"inputs": [],
128+
"name": "NUM_ORACLES",
129+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
130+
"stateMutability": "view",
131+
"type": "function"
132+
},
133+
{
134+
"inputs": [],
135+
"name": "acceptOwnership",
136+
"outputs": [],
137+
"stateMutability": "nonpayable",
138+
"type": "function"
139+
},
140+
{
141+
"inputs": [
142+
{
143+
"internalType": "bytes32",
144+
"name": "_subgraphDeploymentID",
145+
"type": "bytes32"
146+
},
147+
{ "internalType": "bool", "name": "_deny", "type": "bool" }
148+
],
149+
"name": "checkVotes",
150+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
151+
"stateMutability": "view",
152+
"type": "function"
153+
},
154+
{
155+
"inputs": [],
156+
"name": "currentNonce",
157+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
158+
"stateMutability": "view",
159+
"type": "function"
160+
},
161+
{
162+
"inputs": [],
163+
"name": "executionThreshold",
164+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
165+
"stateMutability": "view",
166+
"type": "function"
167+
},
168+
{
169+
"inputs": [],
170+
"name": "governor",
171+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
172+
"stateMutability": "view",
173+
"type": "function"
174+
},
175+
{
176+
"inputs": [
177+
{ "internalType": "uint256", "name": "", "type": "uint256" },
178+
{ "internalType": "bytes32", "name": "", "type": "bytes32" },
179+
{ "internalType": "uint256", "name": "", "type": "uint256" }
180+
],
181+
"name": "lastAllowVote",
182+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
183+
"stateMutability": "view",
184+
"type": "function"
185+
},
186+
{
187+
"inputs": [
188+
{ "internalType": "uint256", "name": "", "type": "uint256" },
189+
{ "internalType": "bytes32", "name": "", "type": "bytes32" },
190+
{ "internalType": "uint256", "name": "", "type": "uint256" }
191+
],
192+
"name": "lastDenyVote",
193+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
194+
"stateMutability": "view",
195+
"type": "function"
196+
},
197+
{
198+
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
199+
"name": "oracles",
200+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
201+
"stateMutability": "view",
202+
"type": "function"
203+
},
204+
{
205+
"inputs": [],
206+
"name": "pendingGovernor",
207+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
208+
"stateMutability": "view",
209+
"type": "function"
210+
},
211+
{
212+
"inputs": [
213+
{ "internalType": "uint256", "name": "_index", "type": "uint256" },
214+
{ "internalType": "address", "name": "_oracle", "type": "address" }
215+
],
216+
"name": "setOracle",
217+
"outputs": [],
218+
"stateMutability": "nonpayable",
219+
"type": "function"
220+
},
221+
{
222+
"inputs": [
223+
{ "internalType": "uint256", "name": "_voteTimeLimit", "type": "uint256" }
224+
],
225+
"name": "setVoteTimeLimit",
226+
"outputs": [],
227+
"stateMutability": "nonpayable",
228+
"type": "function"
229+
},
230+
{
231+
"inputs": [
232+
{ "internalType": "address", "name": "_newGovernor", "type": "address" }
233+
],
234+
"name": "transferOwnership",
235+
"outputs": [],
236+
"stateMutability": "nonpayable",
237+
"type": "function"
238+
},
239+
{
240+
"inputs": [
241+
{
242+
"internalType": "bytes32",
243+
"name": "_subgraphDeploymentID",
244+
"type": "bytes32"
245+
},
246+
{ "internalType": "bool", "name": "_deny", "type": "bool" },
247+
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" }
248+
],
249+
"name": "vote",
250+
"outputs": [],
251+
"stateMutability": "nonpayable",
252+
"type": "function"
253+
},
254+
{
255+
"inputs": [
256+
{
257+
"internalType": "bytes32[]",
258+
"name": "_subgraphDeploymentID",
259+
"type": "bytes32[]"
260+
},
261+
{ "internalType": "bool[]", "name": "_deny", "type": "bool[]" },
262+
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" }
263+
],
264+
"name": "voteMany",
265+
"outputs": [],
266+
"stateMutability": "nonpayable",
267+
"type": "function"
268+
},
269+
{
270+
"inputs": [],
271+
"name": "voteTimeLimit",
272+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
273+
"stateMutability": "view",
274+
"type": "function"
275+
}
276+
]

config/test.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

networks.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arbitrum-sepolia": {
3+
"SubgraphAvailabilityManager": {
4+
"address": "0x9bDC3264596850E7F5d141A8D898dFA7001355CC",
5+
"startBlock": 22552633
6+
}
7+
}
8+
}

package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "network-monitoring-subgraph",
3+
"license": "UNLICENSED",
4+
"scripts": {
5+
"codegen": "graph codegen",
6+
"build": "graph build",
7+
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ network-monitoring-subgraph",
8+
"create-local": "graph create --node http://localhost:8020/ network-monitoring-subgraph",
9+
"remove-local": "graph remove --node http://localhost:8020/ network-monitoring-subgraph",
10+
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 network-monitoring-subgraph",
11+
"test": "yarn && yarn prep:test && yarn codegen && graph test",
12+
"prep:test": "mustache ./config/test.json subgraph.template.yaml > subgraph.yaml"
13+
},
14+
"dependencies": {
15+
"@graphprotocol/graph-cli": "0.61.0",
16+
"@graphprotocol/graph-ts": "0.30.0"
17+
},
18+
"devDependencies": {
19+
"matchstick-as": "0.5.0",
20+
"mustache": "^4.2.0"
21+
}
22+
}

0 commit comments

Comments
 (0)