Skip to content

Commit

Permalink
Merge branch 'main' into horizon
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Feb 7, 2025
2 parents 6e8335d + 18e1486 commit 33557eb
Show file tree
Hide file tree
Showing 44 changed files with 1,115 additions and 256 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-balloons-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphprotocol/contracts": patch
---

make sdk and console table printer a dev dep
51 changes: 0 additions & 51 deletions .github/workflows/e2e-contracts.yml

This file was deleted.

19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
<a href="https://github.com/graphprotocol/contracts/actions/workflows/build.yml">
<img src="https://github.com/graphprotocol/contracts/actions/workflows/build.yml/badge.svg" alt="Build">
</a>
<a href="https://github.com/graphprotocol/contracts/actions/workflows/ci.yml">
<img src="https://github.com/graphprotocol/contracts/actions/workflows/ci.yml/badge.svg" alt="CI">
</a>
<a href="https://github.com/graphprotocol/contracts/actions/workflows/e2e.yml">
<img src="https://github.com/graphprotocol/contracts/actions/workflows/e2e.yml/badge.svg" alt="E2E">
<a href="https://github.com/graphprotocol/contracts/actions/workflows/ci-contracts.yml">
<img src="https://github.com/graphprotocol/contracts/actions/workflows/ci-contracts.yml/badge.svg" alt="CI-Contracts">
</a>
</p>

Expand All @@ -37,13 +34,13 @@ This repository is a Yarn workspaces monorepo containing the following packages:
| Package | Latest version | Description |
| --- | --- | --- |
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
| [eslint-graph-config](./packages/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for TypeScript projects. |
| [horizon](./packages/horizon) | [![npm version]()]() | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
| [eslint-graph-config](./packages/eslint-graph-config) | - | Shared linting and formatting rules for TypeScript projects. |
| [horizon](./packages/horizon) | - | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts |
| [solhint-graph-config](./packages/solhint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
| [solhint-plugin-graph](./packages/solhint-plugin-graph) | [![npm version]()]() | Plugin for Solhint with specific Graph linting rules. |
| [subgraph-service](./packages/subgraph-service) | [![npm version]()]() | Contracts for the Subgraph data service in Graph Horizon. |
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
| [solhint-graph-config](./packages/solhint-graph-config) | - | Shared linting and formatting rules for Solidity projects. |
| [solhint-plugin-graph](./packages/solhint-plugin-graph) | - | Plugin for Solhint with specific Graph linting rules. |
| [subgraph-service](./packages/subgraph-service) | - | Contracts for the Subgraph data service in Graph Horizon. |
| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants |


## Development
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# @graphprotocol/contracts

## 7.0.0
## 6.3.0

### Major Changes
### Minor Changes

- 9686ce1: Add Horizon staking interface
- Remove restriction that prevented closing allocations older than 1 epoch.

## 6.2.1

Expand Down
29 changes: 24 additions & 5 deletions packages/contracts/addresses-staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@
"txHash": "0x5ae51383f5ad1e434a78c2a6d5393d497be315c40287d827c63c4ca48cc66aca",
"proxy": true,
"implementation": {
"address": "0xC4Cfde877Bc77fD93378D33Ec26330127Ed93bbE",
"creationCodeHash": "0x9319aaf6b70b423fa04ad747f004961123e7833b269f69ecff902db13b010fa2",
"runtimeCodeHash": "0x9a3f54b5f61709d40a71892f241f61fc72cf95346e5d928f1d699ea57065efc4",
"txHash": "0x1e53eadecdb33a8e90e5c9bc3d02d438dd21217c5017b596b3e51f64be4501e2",
"address": "0x0a6b1efb7b2e9A27Cf7C5ED1bdF1Bd03bF8F5600",
"creationCodeHash": "0x60bc1fda6913ef750a1d931e87068d0f6cd62b8b42a4fff13b304b9c0c278557",
"runtimeCodeHash": "0xd8bbd97b94f8ac45a479c55c0416e7b0ebef6a99da8ef7580bebaaad1d8d74d9",
"txHash": "0x5d9276e47f3d1fa1fe5c6d826534722aa73d47f5a114e844de73a3cf0cb22d6b",
"libraries": {
"LibExponential": "0x6f6Db03f7F3bBE43669F81FD954Bd083FEdBb4a5"
"LibExponential": "0xb7fB963257d4f31F88021d2D7Ee53688e38A0938"
}
}
},
Expand Down Expand Up @@ -203,6 +203,25 @@
"runtimeCodeHash": "0xd853da2001c213dd00d674114c254f18a7b5a36aabc5452fb492b9b4faf2faa9",
"txHash": "0xf868871475dc711c5c03818b16a922f740bc2fc314d24586df2255161a907422"
}
},
"SubgraphAvailabilityManager": {
"address": "0xF00AA63f1a8eE67BAD135759eC7a6542b1d56a8f",
"constructorArgs": [
"0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3",
"0x00b9d319E3D09E83c62f453B44354049Dd93a345",
"3",
"300",
[
"0xb4d396a40BB976118Bb2c9DB9C5539e65c7Fe64A",
"0x633259dB4A33DB664d4C3Fa57BEc45E5030131E2",
"0x9FC436A69E290227b99A9CE0468a1b9D73068E80",
"0xC9b90ab0B9cA63fDBfB46f66BE813ea94561614d",
"0xf3B8F917EcFA569089CF6A0988F9a9F5155cEF83"
]
],
"creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da",
"runtimeCodeHash": "0xe6c0ccd0b0514dd55e58806b1c84f09805dd6202985722579c11d7e252df6b8d",
"txHash": "0x5c1dd91c76e547fe31a5df822353b50e93eb795b915aac0ea8f8364229e9c29c"
}
},
"11155111": {
Expand Down
58 changes: 48 additions & 10 deletions packages/contracts/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@
"txHash": "0xa33c0d58ddaed7e3f7381a33e3d5f63e39219863019f00d54ce2fd2446076ac7",
"proxy": true,
"implementation": {
"address": "0x4a886d3E44C7731Dcf888Da704CA5C51ed63DfC8",
"creationCodeHash": "0xa9796308a637b0bfe091f32c1019e4db8efe4bab80788c052fa334e6810c3a98",
"runtimeCodeHash": "0x19d3491cab54b2aae04d05525a532200e946ce9b55573b58f2e3e1606b4514be",
"txHash": "0xc3235306a51c20b28a8b05da69859e03a081a84c9914156c79da07dcc45b3b4e",
"address": "0x0Dae36adCbE384a31309269448E09465B2288429",
"creationCodeHash": "0x7bd2944ba001c51a42d88f89b10eb894e11be62ee96e76331309ff6a8e9b20ff",
"runtimeCodeHash": "0x0808fafef220cfddb64a51f680a18e455d5b7c6b9c0c7aad8f8067f4775dd204",
"txHash": "0x6bdee0f03f74df2b7e6141075b06a88b201cbc78a131aa0fe6bb1ef1da1e2dc1",
"libraries": {
"LibExponential": "0x208f638d8804e4ccc874ec39e240feea3dc289ee"
"LibExponential": "0x6F436161bBa439FB7D0A6192D22dd8fcE4C26Fb5"
}
}
},
Expand Down Expand Up @@ -790,6 +790,25 @@
"creationCodeHash": "0xbfc20ab9b880712ab90b5dec9d2a14c724b0bf7c20f02ede8ea76610bd41b6ef",
"runtimeCodeHash": "0xd7fdd744c7a88993435a2978876b1e4341c5e0fb4d611011bb56e8738ab2485d",
"txHash": "0xcc449d1ca1007fba76b25e987ea0d39164acf4027c10c40bd669ede1c65dc569"
},
"SubgraphAvailabilityManager": {
"address": "0x1cB555359319A94280aCf85372Ac2323AaE2f5fd",
"constructorArgs": [
"0x8C6de8F8D562f3382417340A6994601eE08D3809",
"0x971B9d3d0Ae3ECa029CAB5eA1fB0F72c85e6a525",
"3",
"300",
[
"0xdcAA0a094F2Eb7cF7f73248EE64217D59B7B938d",
"0xBD9dc46cb1dd9F31dCbF0617c2Dd5f77A21dB8e8",
"0x16eAd4088d4308a7A4E0F7a1455ed56CDf1AC8AA",
"0x61923453906Eadc15fc1F610B8D1b67bc27658c2",
"0x10eb33C5E2fb6c7a37B110Cc4930d03A9e4C4D09"
]
],
"creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da",
"runtimeCodeHash": "0x52fcfd39c6ab3cf5ed4a736bc38eb1153d73c8cf1ca9e23370badc7843467ab4",
"txHash": "0x2eb44036d157e39c56377403029aebde4961028b404fc8c3f4cadc0f299d06dd"
}
},
"421613": {
Expand Down Expand Up @@ -1146,12 +1165,12 @@
"txHash": "0x326cf1f2849da4bb4d7e39f2783779e3c99fa48e4ee8ef004cfdd50c62e775df",
"proxy": true,
"implementation": {
"address": "0xD07dFD514dc1b57020e6C1F49e05c48d0658C99f",
"creationCodeHash": "0x6a763345e5f166ea4e73ce9a116a49c9fc0833d9ea235a86fa5a997e91cf09e5",
"runtimeCodeHash": "0xb4c31859ac132241f04c802d4add70a94c7f2c6eb9dfd4bf224048d249dbc7bc",
"txHash": "0x68b34eda64287b84582c8f005c4e96162252d36c9c5c9b84332336a7c2e3d6d3",
"address": "0x64Ed77b164d3B22339DA4DB6d56a1C1d8A051c0A",
"creationCodeHash": "0x56a3dd587f3f4ae38dd782e9c35125fa7015c708394950de90bc190204502438",
"runtimeCodeHash": "0x9040ccf84a89ba2e7a32eb297f0da148827e7e272b20d9e57b1acf749baa35da",
"txHash": "0xbfec14a2dd1a571612076b71b4f2e78ea18f95d7d80e14cd1456ecaa7466db54",
"libraries": {
"LibExponential": "0xd844116f6d79a280b117Bb6d9EBf4121D4e8B44b"
"LibExponential": "0x413d16eF53d3dd8b7e769570115ee5419CF77C98"
}
}
},
Expand Down Expand Up @@ -1221,6 +1240,25 @@
"creationCodeHash": "0x20cd202f7991716a84c097da5fbd365fd27f7f35f241f82c529ad7aba18b814b",
"runtimeCodeHash": "0x5f396ffd54b6cd6b3faded0f366c5d7e148cc54743926061be2dfd12a75391de",
"txHash": "0x2cefbc169b8ae51c263d0298956d86a397b05f11f076b71c918551f63fe33784"
},
"SubgraphAvailabilityManager": {
"address": "0x71D9aE967d1f31fbbD1817150902de78f8f2f73E",
"constructorArgs": [
"0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3",
"0x1F49caE7669086c8ba53CC35d1E9f80176d67E79",
"3",
"300",
[
"0x5e4e823Ed094c035133eEC5Ec0d08ae1Af04e9Fa",
"0x5aeE4c46cF9260E85E630ca7d9D757D5D5DbaFD6",
"0x7369Cf2a917296c36f506144f3dE552403d1e1f1",
"0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54",
"0x711aEA1f358DFAf74D34B4B525F9190e631F406C"
]
],
"creationCodeHash": "0xc34842fa42ee2f21e3a435b52fa69a122a5de795448faa890fbc63d4838f45da",
"runtimeCodeHash": "0x3907d0fe5a1fa28fee51100e57a3b193dfcee6720163067011e787262b1749bb",
"txHash": "0xb00751b4dc1c0603fe1b8b9ae9de8840ad1c29b42489c5bb267d80b10ae44ef0"
}
},
"11155111": {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 14 additions & 2 deletions packages/contracts/config/graph.arbitrum-hardhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ general:
arbitrator: &arbitrator "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0" # Arbitration Council
governor: &governor "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b" # Graph Council
authority: &authority "0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d" # Authority that signs payment vouchers
availabilityOracle: &availabilityOracle "0xd03ea8624C8C5987235048901fB614fDcA89b117" # Subgraph Availability Oracle
availabilityOracles: &availabilityOracles # Subgraph Availability Oracles
- "0xd03ea8624C8C5987235048901fB614fDcA89b117"
- "0xd03ea8624C8C5987235048901fB614fDcA89b117"
- "0xd03ea8624C8C5987235048901fB614fDcA89b117"
- "0xd03ea8624C8C5987235048901fB614fDcA89b117"
- "0xd03ea8624C8C5987235048901fB614fDcA89b117"
pauseGuardian: &pauseGuardian "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC" # Protocol pause guardian
allocationExchangeOwner: &allocationExchangeOwner "0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9" # Allocation Exchange owner

Expand Down Expand Up @@ -131,7 +136,7 @@ contracts:
- fn: "setIssuancePerBlock"
issuancePerBlock: "114155251141552511415" # per block increase of total supply, blocks in a year = 365*60*60*24/12
- fn: "setSubgraphAvailabilityOracle"
subgraphAvailabilityOracle: *availabilityOracle
subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}"
- fn: "syncAllContracts"
AllocationExchange:
init:
Expand All @@ -149,3 +154,10 @@ contracts:
- fn: "syncAllContracts"
- fn: "setPauseGuardian"
pauseGuardian: *pauseGuardian
SubgraphAvailabilityManager:
init:
governor: *governor
rewardsManager: "${{RewardsManager.address}}"
executionThreshold: 5
voteTimeLimit: 300
oracles: *availabilityOracles
16 changes: 14 additions & 2 deletions packages/contracts/config/graph.arbitrum-localhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ general:
arbitrator: &arbitrator "0x4237154FE0510FdE3575656B60c68a01B9dCDdF8" # Arbitration Council
governor: &governor "0x1257227a2ECA34834940110f7B5e341A5143A2c4" # Graph Council
authority: &authority "0x12B8D08b116E1E3cc29eE9Cf42bB0AA8129C3215" # Authority that signs payment vouchers
availabilityOracle: &availabilityOracle "0x7694a48065f063a767a962610C6717c59F36b445" # Subgraph Availability Oracle
availabilityOracles: &availabilityOracles # Subgraph Availability Oracles
- "0x7694a48065f063a767a962610C6717c59F36b445"
- "0x7694a48065f063a767a962610C6717c59F36b445"
- "0x7694a48065f063a767a962610C6717c59F36b445"
- "0x7694a48065f063a767a962610C6717c59F36b445"
- "0x7694a48065f063a767a962610C6717c59F36b445"
pauseGuardian: &pauseGuardian "0x601060e0DC5349AA55EC73df5A58cB0FC1cD2e3C" # Protocol pause guardian
allocationExchangeOwner: &allocationExchangeOwner "0xbD38F7b67a591A5cc7D642e1026E5095B819d952" # Allocation Exchange owner

Expand Down Expand Up @@ -132,7 +137,7 @@ contracts:
- fn: "setIssuancePerBlock"
issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12
- fn: "setSubgraphAvailabilityOracle"
subgraphAvailabilityOracle: *availabilityOracle
subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}"
- fn: "syncAllContracts"
AllocationExchange:
init:
Expand All @@ -150,3 +155,10 @@ contracts:
- fn: "syncAllContracts"
- fn: "setPauseGuardian"
pauseGuardian: *pauseGuardian
SubgraphAvailabilityManager:
init:
governor: *governor
rewardsManager: "${{RewardsManager.address}}"
executionThreshold: 5
voteTimeLimit: 300
oracles: *availabilityOracles
16 changes: 14 additions & 2 deletions packages/contracts/config/graph.arbitrum-sepolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ general:
arbitrator: &arbitrator "0x1726A5d52e279d02ff4732eCeB2D67BFE5Add328" # EOA (TODO: update to a multisig)
governor: &governor "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3" # EOA (TODO: update to a multisig)
authority: &authority "0x49D4CFC037430cA9355B422bAeA7E9391e1d3215" # Authority that signs payment vouchers
availabilityOracle: &availabilityOracle "0x5e4e823Ed094c035133eEC5Ec0d08ae1Af04e9Fa" # Subgraph Availability Oracle
availabilityOracles: &availabilityOracles # Array of Subgraph Availability Oracles
- "0x5e4e823Ed094c035133eEC5Ec0d08ae1Af04e9Fa"
- "0x5aeE4c46cF9260E85E630ca7d9D757D5D5DbaFD6"
- "0x7369Cf2a917296c36f506144f3dE552403d1e1f1"
- "0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54"
- "0x711aEA1f358DFAf74D34B4B525F9190e631F406C"
pauseGuardian: &pauseGuardian "0xa0444508232dA3FA6C2f96a5f105f3f0cc0d20D7" # Protocol pause guardian
allocationExchangeOwner: &allocationExchangeOwner "0x72ee30d43Fb5A90B3FE983156C5d2fBE6F6d07B3" # Allocation Exchange owner

Expand Down Expand Up @@ -131,7 +136,7 @@ contracts:
- fn: "setIssuancePerBlock"
issuancePerBlock: "6036500000000000000" # per block increase of total supply, blocks in a year = 365*60*60*24/12
- fn: "setSubgraphAvailabilityOracle"
subgraphAvailabilityOracle: *availabilityOracle
subgraphAvailabilityOracle: "${{SubgraphAvailabilityManager.address}}"
- fn: "syncAllContracts"
AllocationExchange:
init:
Expand All @@ -149,3 +154,10 @@ contracts:
- fn: "syncAllContracts"
- fn: "setPauseGuardian"
pauseGuardian: *pauseGuardian
SubgraphAvailabilityManager:
init:
governor: *governor
rewardsManager: "${{RewardsManager.address}}"
executionThreshold: 5
voteTimeLimit: 300
oracles: *availabilityOracles
2 changes: 0 additions & 2 deletions packages/contracts/contracts/rewards/IRewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ interface IRewardsManager {

function setDenied(bytes32 _subgraphDeploymentID, bool _deny) external;

function setDeniedMany(bytes32[] calldata _subgraphDeploymentID, bool[] calldata _deny) external;

function isDenied(bytes32 _subgraphDeploymentID) external view returns (bool);

// -- Getters --
Expand Down
16 changes: 0 additions & 16 deletions packages/contracts/contracts/rewards/RewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,6 @@ contract RewardsManager is RewardsManagerV5Storage, GraphUpgradeable, IRewardsMa
_setDenied(_subgraphDeploymentID, _deny);
}

/**
* @dev Denies to claim rewards for multiple subgraph.
* NOTE: Can only be called by the subgraph availability oracle
* @param _subgraphDeploymentID Array of subgraph deployment ID
* @param _deny Array of denied status for claiming rewards for each subgraph
*/
function setDeniedMany(
bytes32[] calldata _subgraphDeploymentID,
bool[] calldata _deny
) external override onlySubgraphAvailabilityOracle {
require(_subgraphDeploymentID.length == _deny.length, "!length");
for (uint256 i = 0; i < _subgraphDeploymentID.length; i++) {
_setDenied(_subgraphDeploymentID[i], _deny[i]);
}
}

/**
* @dev Internal: Denies to claim rewards for a subgraph.
* @param _subgraphDeploymentID Subgraph deployment ID
Expand Down
Loading

0 comments on commit 33557eb

Please sign in to comment.