-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add subgraph availability manager contract
- Loading branch information
Showing
11 changed files
with
4,409 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Ignore truffle stuff | ||
build/ | ||
|
||
generated/ | ||
node_modules/ | ||
src/types/ | ||
src/mappings/helpers/metadata.ts | ||
.DS_STORE | ||
yarn-error.log | ||
subgraph.yaml | ||
config/addresses.ts | ||
config/generatedAddresses.json | ||
tests/.bin | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,276 @@ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_governor", "type": "address" }, | ||
{ | ||
"internalType": "address", | ||
"name": "_rewardsManager", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "_executionThreshold", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "_voteTimeLimit", | ||
"type": "uint256" | ||
}, | ||
{ "internalType": "address[5]", "name": "_oracles", "type": "address[5]" } | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
} | ||
], | ||
"name": "NewOwnership", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
} | ||
], | ||
"name": "NewPendingOwnership", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "uint256", | ||
"name": "index", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "oracle", | ||
"type": "address" | ||
} | ||
], | ||
"name": "OracleSet", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "subgraphDeploymentID", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "bool", | ||
"name": "deny", | ||
"type": "bool" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "uint256", | ||
"name": "oracleIndex", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "timestamp", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "OracleVote", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "voteTimeLimit", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "VoteTimeLimitSet", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "NUM_ORACLES", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "acceptOwnership", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_subgraphDeploymentID", | ||
"type": "bytes32" | ||
}, | ||
{ "internalType": "bool", "name": "_deny", "type": "bool" } | ||
], | ||
"name": "checkVotes", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "currentNonce", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "executionThreshold", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "governor", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "", "type": "uint256" }, | ||
{ "internalType": "bytes32", "name": "", "type": "bytes32" }, | ||
{ "internalType": "uint256", "name": "", "type": "uint256" } | ||
], | ||
"name": "lastAllowVote", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "", "type": "uint256" }, | ||
{ "internalType": "bytes32", "name": "", "type": "bytes32" }, | ||
{ "internalType": "uint256", "name": "", "type": "uint256" } | ||
], | ||
"name": "lastDenyVote", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"name": "oracles", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "pendingGovernor", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_index", "type": "uint256" }, | ||
{ "internalType": "address", "name": "_oracle", "type": "address" } | ||
], | ||
"name": "setOracle", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_voteTimeLimit", "type": "uint256" } | ||
], | ||
"name": "setVoteTimeLimit", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_newGovernor", "type": "address" } | ||
], | ||
"name": "transferOwnership", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "_subgraphDeploymentID", | ||
"type": "bytes32" | ||
}, | ||
{ "internalType": "bool", "name": "_deny", "type": "bool" }, | ||
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" } | ||
], | ||
"name": "vote", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32[]", | ||
"name": "_subgraphDeploymentID", | ||
"type": "bytes32[]" | ||
}, | ||
{ "internalType": "bool[]", "name": "_deny", "type": "bool[]" }, | ||
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" } | ||
], | ||
"name": "voteMany", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "voteTimeLimit", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"sepolia": { | ||
"SubgraphAvailabilityManager": { | ||
"address": "0x0539C6995aC74eBCBa449D88fD947eeD2877bE34", | ||
"startBlock": 5109718 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "network-monitoring-subgraph", | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"codegen": "graph codegen", | ||
"build": "graph build", | ||
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ network-monitoring-subgraph", | ||
"create-local": "graph create --node http://localhost:8020/ network-monitoring-subgraph", | ||
"remove-local": "graph remove --node http://localhost:8020/ network-monitoring-subgraph", | ||
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 network-monitoring-subgraph", | ||
"test": "graph test" | ||
}, | ||
"dependencies": { | ||
"@graphprotocol/graph-cli": "0.61.0", | ||
"@graphprotocol/graph-ts": "0.30.0" | ||
}, | ||
"devDependencies": { "matchstick-as": "0.5.0" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
type NewOwnership @entity(immutable: true) { | ||
id: Bytes! | ||
from: Bytes! # address | ||
to: Bytes! # address | ||
blockNumber: BigInt! | ||
blockTimestamp: BigInt! | ||
transactionHash: Bytes! | ||
} | ||
|
||
type NewPendingOwnership @entity(immutable: true) { | ||
id: Bytes! | ||
from: Bytes! # address | ||
to: Bytes! # address | ||
blockNumber: BigInt! | ||
blockTimestamp: BigInt! | ||
transactionHash: Bytes! | ||
} | ||
|
||
type OracleSet @entity(immutable: true) { | ||
id: Bytes! | ||
index: BigInt! # uint256 | ||
oracle: Bytes! # address | ||
blockNumber: BigInt! | ||
blockTimestamp: BigInt! | ||
transactionHash: Bytes! | ||
} | ||
|
||
type OracleVote @entity(immutable: true) { | ||
id: Bytes! | ||
subgraphDeploymentID: Bytes! # bytes32 | ||
deny: Boolean! # bool | ||
oracleIndex: BigInt! # uint256 | ||
timestamp: BigInt! # uint256 | ||
blockNumber: BigInt! | ||
blockTimestamp: BigInt! | ||
transactionHash: Bytes! | ||
} | ||
|
||
type VoteTimeLimitSet @entity(immutable: true) { | ||
id: Bytes! | ||
voteTimeLimit: BigInt! # uint256 | ||
blockNumber: BigInt! | ||
blockTimestamp: BigInt! | ||
transactionHash: Bytes! | ||
} |
Oops, something went wrong.