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

❄️ Graph Horizon and Subgraph Service ❄️ #944

Open
wants to merge 303 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
303 commits
Select commit Hold shift + click to select a range
7cd7374
Merge pull request #972 from graphprotocol/mde/fix-escrow-and-payment…
Maikol May 23, 2024
8f7b21d
Merge branch 'horizon' of github.com:graphprotocol/contracts into hor…
tmigone May 23, 2024
ac5546d
chore: enforce consistent variable naming
tmigone May 23, 2024
187daaf
chore: use PPMMath
tmigone May 23, 2024
04432d2
fix: take pending rewards for subgraph service
tmigone May 23, 2024
92f3a55
chore: use graph payments payment types instead of uint8
tmigone May 23, 2024
b95655e
chore: rename indexer to service provider
tmigone May 23, 2024
90e5b7c
chore: more indexer renames
tmigone May 23, 2024
b220761
chore: remove unnecessary pragma abicoder
tmigone May 23, 2024
4442335
chore: update solidity version, remove duplicate files
tmigone May 23, 2024
f4802b2
chore: pin solidity version to 0.8.24
tmigone May 23, 2024
a390aea
Tmigone/horizon staking revamp (#973)
tmigone May 24, 2024
aa9e908
chore: rework interface directory
tmigone May 24, 2024
ca633f4
chore: disable autofix for solhint plugin, its bugged
tmigone May 24, 2024
eef74f6
chore: order staking functions
tmigone May 24, 2024
3ca420e
chore: staking function ordering
tmigone May 24, 2024
1f4db70
fix(ss): interface importsy
tmigone May 24, 2024
511ef30
chore: ensure events and errors consistency
tmigone May 24, 2024
5542532
chore: update provision event
tmigone May 24, 2024
6255c48
feat: updated solidity to 0.8.26
tmigone May 24, 2024
9118567
chore: use IR to compile solidity
tmigone May 24, 2024
106f388
feat: use require with custom errors
tmigone May 24, 2024
b5cb905
fix: couple fixes
tmigone May 24, 2024
180513e
feat: remove partial pause
tmigone May 24, 2024
e7c00c1
chore: add horizon unit tests
Maikol May 25, 2024
ed3fa1e
chore: update solidity version
Maikol May 25, 2024
b05d064
fix: failing tests
Maikol May 27, 2024
5655a89
chore: disable optimizer for tests
tmigone May 27, 2024
f1f2883
Merge pull request #974 from graphprotocol/mde/horizon-staking-tests-…
Maikol May 27, 2024
6a48e4d
fix: foundry profile usage
tmigone May 27, 2024
6e3ab78
chore: remove duplicate code from staking
tmigone May 27, 2024
a9277b4
feat: add linked list library (#975)
tmigone May 28, 2024
1c62027
feat: make fees extension only one type of payment
tmigone May 28, 2024
c11b31e
feat: make subgraph service and graph payments upgradeable
tmigone May 28, 2024
75c5b36
chore: complete some interfaces
tmigone May 28, 2024
a2c8b38
fix: slashing horizon delegation
Maikol May 27, 2024
7bea047
docs: add natspec to horizon staking base contract
tmigone May 28, 2024
19591b3
fix: rebase horizon branch
Maikol May 29, 2024
e5f22e2
Merge pull request #976 from graphprotocol/mde/horizon-staking-slash-fix
Maikol May 29, 2024
5091e7d
fix: withdraw delegation with zero tokens
Maikol May 28, 2024
c212cbe
fix: rebase
Maikol May 29, 2024
d7497d6
docs: add natspec to horizon staking contracts
tmigone May 29, 2024
c3fe9d1
Merge branch 'horizon' of github.com:graphprotocol/contracts into hor…
tmigone May 29, 2024
75d3cb9
docs: add natspec to data service fees extension contract
tmigone May 29, 2024
6093c53
Merge pull request #977 from graphprotocol/mde/fix-zero-tokens-withdr…
Maikol May 29, 2024
8616335
docs: add natspec to data service contracts
tmigone May 30, 2024
641842e
docs: add natspec to payments protocol contracts and libraries
tmigone May 30, 2024
289772e
fix: update GraphEscrow to EscrowPayments
Maikol May 31, 2024
685f457
fix: unit tests
Maikol Jun 3, 2024
a83e887
fix: remove commented code
Maikol Jun 3, 2024
1aef94b
Merge pull request #978 from graphprotocol/mde/fix-horizon-tests
Maikol Jun 3, 2024
2733112
docs: finalize natspec
tmigone Jun 3, 2024
d369c08
chore: lint fixes
tmigone Jun 3, 2024
9ed2a72
chore: trim unused code from LibFixedMath
tmigone Jun 3, 2024
4f6436a
chore: add governance tests
Maikol Jun 3, 2024
695f391
Merge pull request #979 from graphprotocol/mde/horizon-governance-tests
Maikol Jun 3, 2024
95bb940
chore: add tokens locked tests
Maikol Jun 4, 2024
5d7bb22
chore: legacy subgraph service tests
Maikol Jun 4, 2024
0ebdbae
chore: deployments tests
Maikol Jun 4, 2024
646198e
chore: comments heading
Maikol Jun 4, 2024
352d7f1
chore: staking service provider tests
Maikol Jun 4, 2024
cec2639
fix: vm.assume rejecting too many options
Maikol Jun 4, 2024
c26e06b
chore: add set staking counterpart address
Maikol Jun 4, 2024
d109bbc
test: add tests for linked list library
tmigone Jun 4, 2024
c8c4eeb
chore: added more staking service provider tests
Maikol Jun 4, 2024
05de8aa
fix: remove MIN_PROVISION_SIZE from horizon staking
Maikol Jun 4, 2024
60faa92
Merge pull request #980 from graphprotocol/mde/remove-minimum-provisi…
Maikol Jun 5, 2024
3a4507c
test: add provision tracker tests
tmigone Jun 5, 2024
783c6f7
test: add GraphDirectory tests
tmigone Jun 5, 2024
ec7a374
test: add base data service tests
tmigone Jun 5, 2024
82cc903
test: add upgradeable data service test
tmigone Jun 5, 2024
9c6f70f
fix: bad import path for graph directory
tmigone Jun 7, 2024
9cb27fe
fix: feedback fixes
tmigone Jun 7, 2024
a7d8ec4
chore: horizon allocation fix and tests (#981)
Maikol Jun 7, 2024
04bf4c7
chore: horizon allocation with beneficiary test
Maikol Jun 7, 2024
66f9767
chore: horizon close collection with delegation fees
Maikol Jun 7, 2024
99c273e
fix: change delegation ratio to be a value instead of range
tmigone Jun 7, 2024
1741ea2
fix: moar feedback fixes
tmigone Jun 7, 2024
6f376cd
fix: ensure rewards manager looks at subgraph service and staking for…
tmigone Jun 7, 2024
02a2fc3
feat: use poi to create dispute
tmigone Jun 7, 2024
aba7ac5
feat: use poi to create dispute id
tmigone Jun 7, 2024
df297f7
test: add data service framework tests
tmigone Jun 11, 2024
e5c3ec1
chore: linting stuff
tmigone Jun 11, 2024
bc4aba1
chore: more linting
tmigone Jun 11, 2024
203a3b0
fix: require params change when calling set provision parameters
tmigone Jun 11, 2024
da34d9b
test: add tests for DataServicePausable
tmigone Jun 12, 2024
17d3b79
test: upgradeable contracts
tmigone Jun 12, 2024
54c4a39
test: more pausable
tmigone Jun 12, 2024
086a94c
test: add data service fees tests
tmigone Jun 13, 2024
6627b7d
fix: remove console import
tmigone Jun 14, 2024
b4f3285
Merge pull request #983 from graphprotocol/horizon-fixes
Maikol Jun 17, 2024
c4b4958
chore: refactor dispute manager tests
Maikol Jun 18, 2024
29dedff
chore: add register tests
Maikol Jun 19, 2024
f76fc3f
chore: use HorizonStaking instead of mock implementation
Maikol Jun 19, 2024
d448641
chore: add more subgraph service tests
Maikol Jun 20, 2024
826181c
chore: start allocation tests
Maikol Jun 20, 2024
215758a
chore: stop allocation tests started
Maikol Jun 21, 2024
cd77239
chore: stop allocation tests
Maikol Jun 25, 2024
6b99a6d
WIP
Maikol Jun 26, 2024
30973f1
chore: subgraph service unit tests
Maikol Jun 27, 2024
19cb287
fix: revert unit type change
Maikol Jun 27, 2024
f47cf91
Merge pull request #986 from graphprotocol/mde/subgraph-service-tests
Maikol Jun 27, 2024
0f366d2
fix: update subgraph endpoints to network and some linting
tmigone Aug 14, 2024
d025632
fix: add STUDIO_API_KEY to GitHub action
tmigone Aug 15, 2024
8345a1f
fix: missing env var declaration
tmigone Aug 15, 2024
5c5787a
ci: build packages individudally
tmigone Aug 15, 2024
4bdd237
fix: addToDelegationPool access control and token transfer (OZ C-01)
Maikol Aug 7, 2024
f4f9bad
fix: moved pull tokens and made addToDelegationPool open to all
Maikol Aug 13, 2024
a183d7e
fix: add subgraph service as a caller when collecting from curation c…
Maikol Aug 8, 2024
e0cf705
fix: subgraphService access controll (OZ C-04)
Maikol Aug 8, 2024
857f27b
fix: collecting other indexers query fees
Maikol Aug 9, 2024
0364b41
fix: renaming errors and variables
Maikol Aug 13, 2024
c783118
fix: resize only open allocations and access control (OZ C-05)
Maikol Aug 14, 2024
7876046
fix: change pending rewards due to resize to token amounts instead of…
tmigone Aug 15, 2024
7726b58
fix: pin smock version
tmigone Aug 15, 2024
d80a025
fix: ensure maxVerifierCut is a valid PPM
tmigone Aug 19, 2024
d7814ea
fix: use isvalidPPM
tmigone Aug 19, 2024
4c58b62
fix: cap slash amount to a stake snapshot percentage (OZ M-02)
tmigone Aug 23, 2024
94fe5a0
fix: early return in Staking withdraw (OZ M-03)
Maikol Aug 15, 2024
cab507f
fix: slashing reverts when exceeding provision balance (OZ M-05)
Maikol Aug 16, 2024
6697548
fix: revert when delegating, undelegating or withdrawing from an inva…
Maikol Aug 19, 2024
50a8fa3
fix: rename error
Maikol Aug 20, 2024
bdaa2c4
fix: check for shares thawing
Maikol Aug 20, 2024
3ab169b
fix: return tokens to delegator when bridging if the pool is invalid …
tmigone Aug 22, 2024
5a06dd8
fix: invalid pool detection
tmigone Aug 22, 2024
1650a91
fix: wip
tmigone Aug 20, 2024
afe8bbc
fix: calculation of shares when receiving delegation from l1 (OZ H-03)
tmigone Aug 20, 2024
7d1b2fb
test: add test for receivedelegation special case
tmigone Aug 22, 2024
4787e12
fix: remove subgraph service cut (OZ H-04)
tmigone Aug 21, 2024
0a9fe15
fix: prevent provisions from being overwritten if they exist (OZ H-05)
tmigone Aug 21, 2024
ab8f39b
fix: div by zero when delegating to a pool where all tokens are thawi…
tmigone Aug 21, 2024
61bf0ee
fix: remove white space from typehash calculation (OZ H-07)
tmigone Aug 22, 2024
11b7d44
fix: include rav metadata in signature verification (OZ H-08)
tmigone Aug 23, 2024
03ce865
fix: wip
tmigone Aug 23, 2024
dd6a007
fix: add fn to allow force closing stale allocations (OZ H-09)
tmigone Aug 23, 2024
7b7cff2
fix: timestamp instead of block number
tmigone Aug 23, 2024
36f9112
test: use skip instead of warp
tmigone Aug 23, 2024
41eb02b
fix: max verifier tokens calculation when slashing (OZ H-11)
tmigone Aug 23, 2024
b2bf070
fix: consider tokens allocated to legacy allos as not idle (OZ H-10)
tmigone Aug 23, 2024
b56567e
fix: make fisherman deposit a fixed value (OZ L-01)
Maikol Aug 20, 2024
dc3add0
fix: add max fisherman rewards cut (OZ L-02)
Maikol Aug 21, 2024
3aeb4b6
fix: make PaymentsEscrow upgradable and pausable (OZ L-03)
Maikol Aug 22, 2024
63f6ea1
fix: compute address and deploy using create2
Maikol Aug 22, 2024
d3f5ece
fix: use OpenZeppelin Address to transfer ETH (OZ L-04)
Maikol Aug 22, 2024
4d25fcd
fix: approve collector now increases allowance (OZ L-05)
Maikol Aug 22, 2024
1c6bb31
fix: inonsistent coding style (OZ L-06)
Maikol Aug 22, 2024
fb5956a
fix: missing validations (OZ L-07)
Maikol Aug 23, 2024
2a131ca
fix: missing or incorrect documentation (OZ L-08)
Maikol Aug 23, 2024
7436871
fix: gas inefficiencies (OZ L-09)
Maikol Aug 23, 2024
aa04aa8
fix: allow slashing even if SubgraphService is paused (OZ CR-01)
Maikol Aug 23, 2024
5f74009
WIP
Maikol Aug 23, 2024
1088e22
fix: close allocation when collecting rewards if over allocated (OZ C…
tmigone Aug 23, 2024
b71eca0
fix: remove old address from event (OZ C-01)
Maikol Aug 27, 2024
157bfc6
fix: updated variable description (OZ H-01)
Maikol Aug 27, 2024
99af0a6
fix: update upper bound for verifierCutRange (OZ H-02)
Maikol Aug 27, 2024
e2ac05d
fix: typo (OZ H-04)
Maikol Aug 27, 2024
d8bce8c
fix: encode _rav.metadata as keccak256 hash (OZ H-08)
Maikol Aug 27, 2024
58ba769
fix: remove unused import (OZ L-06)
Maikol Aug 27, 2024
ddbc4d2
fix: remove if conditions (OZ H-02)
Maikol Aug 28, 2024
63d2ba4
Subgraph Service - Unit tests (#1022)
Maikol Sep 9, 2024
4387c6c
test: wip refactor unit tests for staking fns (#1021)
tmigone Sep 9, 2024
282ea51
fix: add security contact to DisputeManager.sol
MoonBoi9001 Sep 17, 2024
491041b
fix: add security contact to GraphPayments.sol
MoonBoi9001 Sep 17, 2024
86fd039
fix: add security contact to HorizonStaking.sol
MoonBoi9001 Sep 17, 2024
5ea1fe9
fix: add security contact to HorizonStakingExtension.sol
MoonBoi9001 Sep 17, 2024
c269117
fix: add security contact to PaymentsEscrow.sol
MoonBoi9001 Sep 17, 2024
61a1544
fix: add security contact to SubgraphService.sol + add NatSpec before…
MoonBoi9001 Sep 17, 2024
d52be6d
fix: add security contact to TAPCollector.sol
MoonBoi9001 Sep 17, 2024
a58f807
fix: change EIP712_ALLOCATION_PROOF_TYPEHASH from variable to constan…
MoonBoi9001 Sep 18, 2024
516a4e3
fix: add override keyword in functions
MoonBoi9001 Sep 18, 2024
9dfb8b0
fix: remove unused return value. (OZ N-10)
MoonBoi9001 Sep 18, 2024
bd62e95
fix: remove unused return values from the Allocation library. (OZ N-10)
MoonBoi9001 Sep 18, 2024
ffe9b89
fix: address magic number use. (OZ N-11)
MoonBoi9001 Sep 18, 2024
374f57d
fix: typographical errors throughout codebase. (OZ N-07)
MoonBoi9001 Sep 19, 2024
79f7828
fix: reorder parameter use in mulPPM function call in mulPPMRoundUp. …
MoonBoi9001 Sep 19, 2024
54286e3
Merge pull request #1040 from graphprotocol/fix_oz_n-10
MoonBoi9001 Sep 19, 2024
0438f62
Merge pull request #1037 from graphprotocol/fix_oz_n-07
MoonBoi9001 Sep 19, 2024
613d7f3
Merge pull request #1043 from graphprotocol/fix_oz_n-12
MoonBoi9001 Sep 19, 2024
4354737
fix: only add to delegation pool if shares is greater than 0 (#1031)
Maikol Sep 19, 2024
fe380e4
fix(SubgraphService): use correct payment type for collect indexing r…
Maikol Sep 19, 2024
95b3f83
fix(Horizon): only allow addToDelegationPool if provision exists and …
Maikol Sep 19, 2024
f2a5498
Merge pull request #1039 from graphprotocol/fix_oz_n-09
MoonBoi9001 Sep 20, 2024
ff7a0ed
Merge pull request #1035 from graphprotocol/fix_oz_n-06
MoonBoi9001 Sep 20, 2024
76e4940
fix: update constant names. (OZ N-11)
MoonBoi9001 Sep 20, 2024
3bdaec6
chore: add stakeToFeesRatio to SubgraphService initialize (#1027)
Maikol Sep 20, 2024
51dd7a8
chore(SubgraphService): add Multicall to SubgraphService (#1030)
Maikol Sep 20, 2024
08539af
fix(SubgraphService): allow collecting rewards when delegation fee cu…
Maikol Sep 20, 2024
3e57ba3
chore(SubgraphService): add current epoch to IndexingRewardsCollected…
Maikol Sep 20, 2024
8912125
Update packages/horizon/contracts/data-service/utilities/ProvisionMan…
MoonBoi9001 Sep 20, 2024
cf2109f
fix: remove unused errors, use LegacyAllocationAlreadyMigrated to pre…
MoonBoi9001 Sep 24, 2024
4ad1ccd
fix: releaseStake n parameter changed to numClaimsToRelease.
MoonBoi9001 Sep 20, 2024
d90b971
fix: function _setPartialPaused(bool _toPause) chnaged to function _s…
MoonBoi9001 Sep 20, 2024
9d819ef
fix: lastPausePartialTime now lastPartialPauseTime..
MoonBoi9001 Sep 20, 2024
2d69d2a
fix: acceptProvision updated to acceptProvisionPendingParameters
MoonBoi9001 Sep 20, 2024
a4ba0ab
fix: rename staged to pending.
MoonBoi9001 Sep 20, 2024
76bedb3
fix: rename maxVerifierCut to newMaxVerifierCut and thawingPeriod to …
MoonBoi9001 Sep 20, 2024
faafe82
fix: onlyProvisionAuthorized now onlyAuthorizedForProvision.
MoonBoi9001 Sep 20, 2024
e73cb44
fix: ProvisionAccepted now ProvisionPendingParametersAccepted.
MoonBoi9001 Sep 20, 2024
69e1971
fix: releaseAt updated to releasableAt
MoonBoi9001 Sep 20, 2024
78821ab
fix: "Resolve the conflicting dispute" updated to "Draw the conflicti…
MoonBoi9001 Sep 20, 2024
99d9bba
fix: MAX_THAWING_PERIOD rename to MAX_WAIT_PERIOD in PaymentsEscrow a…
MoonBoi9001 Sep 20, 2024
9503f1d
fix: challenger and submitter updated to fisherman.
MoonBoi9001 Sep 20, 2024
2729a37
fix: use new constants in subgraphservice.sol
MoonBoi9001 Sep 30, 2024
f8e39df
Merge branch 'horizon' into fix_oz_n-11
MoonBoi9001 Sep 30, 2024
aa27c54
fix: emit amount authorized + rescuded token in AuthorizedCollector/T…
MoonBoi9001 Sep 30, 2024
8ce493f
fix: direct bugs to new security contact email address.
MoonBoi9001 Oct 1, 2024
b721f72
fix: set _verifyAllocationProof visability private.
MoonBoi9001 Oct 1, 2024
fbc6654
fix: set _getDelegatedTokensAvailable visability private.
MoonBoi9001 Oct 1, 2024
decde7f
fix: set _receiveIndexerStake _receiveDelegation visability private.
MoonBoi9001 Oct 1, 2024
b5d3a7d
fix: set _deposit visability private.
MoonBoi9001 Oct 1, 2024
32b3965
fix: set drawDispute visability external.
MoonBoi9001 Oct 1, 2024
157216a
Merge pull request #1028 from graphprotocol/fix_oz_n-03
MoonBoi9001 Oct 1, 2024
96b5c3c
fix: emit both amount authorized and total authorized
MoonBoi9001 Sep 30, 2024
a598eca
fix: set all ProvisionManager constants internal.
MoonBoi9001 Oct 1, 2024
de6c822
fix: remove ProvisionManager inheritance.
MoonBoi9001 Oct 1, 2024
ffd1f79
fix: remove whitespace.
MoonBoi9001 Oct 1, 2024
3a51379
Merge pull request #1041 from graphprotocol/fix_oz_n-11
MoonBoi9001 Oct 1, 2024
f86b12a
feat(horizon): deploy horizon with Hardhat Ignition (#1025)
tmigone Oct 1, 2024
2f3a5e0
chore(Horizon): reprovision only tokens thawed (#1046)
Maikol Oct 1, 2024
fe9d605
chore(SubgraphService): allow force closing over allocated allocation…
Maikol Oct 1, 2024
41f85c8
Merge pull request #1051 from graphprotocol/fix_oz_n-16
MoonBoi9001 Oct 2, 2024
e33bf12
fix: revert DisputeManager.sol to previous state
MoonBoi9001 Oct 2, 2024
2b79a69
fix(Horizon): graph directory test (#1054)
Maikol Oct 2, 2024
31d57b2
Merge pull request #1047 from graphprotocol/fix_oz_n-13
MoonBoi9001 Oct 2, 2024
dcbcf7e
fix: fix broken test
MoonBoi9001 Oct 2, 2024
d459928
Update packages/horizon/contracts/data-service/interfaces/IDataServic…
MoonBoi9001 Oct 2, 2024
8be58f9
Merge pull request #1049 from graphprotocol/fix_oz_n-14
MoonBoi9001 Oct 2, 2024
570b21e
chore(Horizon): add a beneficiary address to undelegate (#1052)
Maikol Oct 2, 2024
4e41890
feat: remove transfer tools from horizon (#1053)
tmigone Oct 3, 2024
2284a3d
fix(Horizon): add input validation for set provision parameters (#1055)
Maikol Oct 3, 2024
f88f335
feat: add rav collected event (#1056)
tmigone Oct 4, 2024
e40c8fe
fix(Horizon): withdraw delegation with beneficiary test fix (#1057)
Maikol Oct 7, 2024
8b3a86b
fix: apply consistent mapping order HorizonStakingNotAuthorized (OZ_N…
MoonBoi9001 Oct 3, 2024
fa9da60
fix: apply consistent mapping order ProvisionManagerNotAuthorized (OZ…
MoonBoi9001 Oct 4, 2024
b75154c
fix: apply consistent mapping order isAuthorized (OZ_N-05)
MoonBoi9001 Oct 4, 2024
cc14383
fix: apply consistent mapping order _isAuthorized (OZ_N-05)
MoonBoi9001 Oct 4, 2024
6af9e66
fix: apply consistent mapping order isAuthorized (OZ_N-05)
MoonBoi9001 Oct 4, 2024
ac965cd
fix: apply consistent mapping order _operatorAuth (OZ_N-05)
MoonBoi9001 Oct 3, 2024
68157c0
fix: swap peram order _getStorage_OperatorAuth
MoonBoi9001 Oct 4, 2024
1693d76
fix: set new peram order various functions (OZ_N-05)
MoonBoi9001 Oct 7, 2024
0f1522d
Update packages/horizon/contracts/data-service/utilities/ProvisionMan…
MoonBoi9001 Oct 7, 2024
a76a0d6
feat: separate escrow accounts for each collector (#1058)
tmigone Oct 8, 2024
f0294b0
Merge pull request #1034 from graphprotocol/fix_oz_n-05
MoonBoi9001 Oct 9, 2024
7035403
fix: tweaks to thawing pool management (#1048)
tmigone Oct 9, 2024
0f5ba68
chore(Horizon): add redelegate option (#1059)
Maikol Oct 9, 2024
36b81e3
fix: delegation withdraw test and typo in subgraph test name
Maikol Oct 10, 2024
516ac3c
chore: added unit tests for PPMMath
Maikol Oct 10, 2024
971a5c5
chore: added unit tests for TAPCollector
Maikol Oct 10, 2024
504fff1
chore(Horizon): add signers to TAPCollector (#1060)
Maikol Oct 11, 2024
0c0d090
fix: lint errors
Maikol Oct 11, 2024
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
2 changes: 2 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ runs:
using: composite

steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Enable corepack for modern yarn
shell: bash
run: corepack enable
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
2 changes: 2 additions & 0 deletions .github/workflows/ci-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci-horizon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI - packages/horizon

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/horizon/**
pull_request:
branches: "*"
paths:
- packages/horizon/**
workflow_dispatch:

jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: |
pushd packages/horizon
yarn test
30 changes: 30 additions & 0 deletions .github/workflows/ci-subgraph-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI - packages/subgraph-service

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/subgraph-service/**
pull_request:
branches: "*"
paths:
- packages/subgraph-service/**
workflow_dispatch:

jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: |
pushd packages/subgraph-service
yarn test
6 changes: 5 additions & 1 deletion .github/workflows/ci-token-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: yarn test
run: |
pushd packages/token-distribution
yarn test
2 changes: 2 additions & 0 deletions .github/workflows/e2e-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run e2e tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Publish 🚀
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/verifydeployed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup

Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ cached/
# Build artifacts
dist/
build/
typechain/
typechain-types/
deployments/hardhat/

# Ignore solc bin output
Expand All @@ -45,8 +47,10 @@ addresses-fork.json
# Keys
.keystore

# Forge artifacts
cache_forge
# Graph client
.graphclient

tx-builder-*.json
!tx-builder-template.json
!tx-builder-template.json
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "packages/subgraph-service/lib/forge-std"]
path = packages/subgraph-service/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/horizon/lib/forge-std"]
path = packages/horizon/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/horizon/lib/openzeppelin-foundry-upgrades"]
path = packages/horizon/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
12 changes: 11 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ pushd packages/contracts
npx --no-install lint-staged
popd

# subgraph service
pushd packages/subgraph-service
npx --no-install lint-staged
popd

# data-edge
pushd packages/data-edge
npx --no-install lint-staged
popd
popd

# graph horizon
pushd packages/horizon
npx --no-install lint-staged
popd
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ This repository is a Yarn workspaces monorepo containing the following packages:
| --- | --- | --- |
| [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. |
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
| [horizon](./packages/horizon) | [![npm version]()]() | 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/eslint-graph-config) | [![npm version]()]() | Shared linting and formatting rules for Solidity projects. |
| [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 |


## Development
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
"packages/contracts",
"packages/data-edge",
"packages/eslint-graph-config",
"packages/horizon",
"packages/sdk",
"packages/solhint-graph-config",
"packages/solhint-plugin-graph",
"packages/subgraph-service",
"packages/token-distribution"
],
"scripts": {
Expand Down
14 changes: 0 additions & 14 deletions packages/contracts/.solhint.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/contracts/.solhintignore

This file was deleted.

6 changes: 6 additions & 0 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @graphprotocol/contracts

## 7.0.0

### Major Changes

- 9686ce1: Add Horizon staking interface
tmigone marked this conversation as resolved.
Show resolved Hide resolved

## 6.2.1

### Patch Changes
Expand Down
5 changes: 5 additions & 0 deletions packages/contracts/contracts/arbitrum/Arbitrum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Arbitrum contracts

These contracts have been copied from the [Arbitrum repo](https://github.com/OffchainLabs/arbitrum).

They are also available as part of the npm packages [arb-bridge-eth](https://www.npmjs.com/package/arb-bridge-eth) and [arb-bridge-peripherals](https://www.npmjs.com/package/arb-bridge-peripherals). The reason for copying them rather than installing those packages is the contracts only support Solidity `^0.6.11`, so we had to change the version to `^0.7.6` for it to be compatible with our other contracts.
24 changes: 12 additions & 12 deletions packages/contracts/contracts/arbitrum/ITokenGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*/

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface ITokenGateway {
/// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated
Expand All @@ -47,20 +47,20 @@ interface ITokenGateway {
// );

function outboundTransfer(
address _token,
address _to,
uint256 _amount,
uint256 _maxGas,
uint256 _gasPriceBid,
bytes calldata _data
address oken,
tmigone marked this conversation as resolved.
Show resolved Hide resolved
address t,
uint256 amunt,
uint256 maxas,
uint256 gasPiceBid,
bytes calldata data
) external payable returns (bytes memory);

function finalizeInboundTransfer(
address _token,
address _from,
address _to,
uint256 _amount,
bytes calldata _data
address token,
address from,
address to,
uint256 amount,
bytes calldata data
) external payable;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/curation/ICuration.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

/**
* @title Curation Interface
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/epochs/IEpochManager.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface IEpochManager {
// -- Configuration --
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/gateway/ICallhookReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* be allowlisted by the governor, but also implement this interface that contains
* the function that will actually be called by the L2GraphTokenGateway.
*/
pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

interface ICallhookReceiver {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Controller.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { IController } from "./IController.sol";
import { IManaged } from "./IManaged.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Governed.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

/**
* @title Graph Governance contract
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IController.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity >=0.6.12 <0.8.0;
pragma solidity ^0.7.6 || 0.8.26;

interface IController {
function getGovernor() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IManaged.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { IController } from "./IController.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

abstract contract Pausable {
/**
Expand Down
20 changes: 2 additions & 18 deletions packages/contracts/contracts/l2/staking/IL2Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma abicoder v2;

import { IStaking } from "../../staking/IStaking.sol";
import { IL2StakingBase } from "./IL2StakingBase.sol";
import { IL2StakingTypes } from "./IL2StakingTypes.sol";

/**
* @title Interface for the L2 Staking contract
Expand All @@ -15,21 +16,4 @@ import { IL2StakingBase } from "./IL2StakingBase.sol";
* the custom setup of the Staking contract where part of the functionality is implemented
* in a separate contract (StakingExtension) to which calls are delegated through the fallback function.
*/
interface IL2Staking is IStaking, IL2StakingBase {
/// @dev Message codes for the L1 -> L2 bridge callhook
enum L1MessageCodes {
RECEIVE_INDEXER_STAKE_CODE,
RECEIVE_DELEGATION_CODE
}

/// @dev Encoded message struct when receiving indexer stake through the bridge
struct ReceiveIndexerStakeData {
address indexer;
}

/// @dev Encoded message struct when receiving delegation through the bridge
struct ReceiveDelegationData {
address indexer;
address delegator;
}
}
interface IL2Staking is IStaking, IL2StakingBase, IL2StakingTypes {}
2 changes: 1 addition & 1 deletion packages/contracts/contracts/l2/staking/IL2StakingBase.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma solidity ^0.7.6 || 0.8.26;

import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol";

Expand Down
Loading
Loading