-
Notifications
You must be signed in to change notification settings - Fork 147
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 service contracts boilerplate
Signed-off-by: Tomás Migone <[email protected]>
- Loading branch information
Showing
8 changed files
with
38 additions
and
53 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
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,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.25; | ||
|
||
interface ISubgraphService { | ||
// register as a provider in the data service | ||
function register(address provisionId, string calldata url, string calldata geohash, uint256 delegatorQueryFeeCut) | ||
external; | ||
|
||
// register as a provider in the data service, create the required provision first | ||
// function provisionAndRegister( | ||
// uint256 tokens, | ||
// string calldata url, | ||
// string calldata geohash, | ||
// uint256 delegatorQueryFeeCut | ||
// ) external; | ||
} |
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.4.0 <0.9.0; | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.25; | ||
|
||
import {Test} from "@graphprotocol/contracts/contracts/staking/IHorizonStaking.sol"; | ||
import {IHorizonStaking} from "@graphprotocol/contracts/contracts/staking/IHorizonStaking.sol"; | ||
import {ISubgraphService} from "./ISubgraphService.sol"; | ||
import {SubgraphServiceV1Storage} from "./SubgraphServiceStorage.sol"; | ||
|
||
contract SimpleTest is Test { | ||
function test() external pure returns (uint256) { | ||
return 42; | ||
contract SubgraphService is SubgraphServiceV1Storage, ISubgraphService { | ||
function register(address provisionId, string calldata url, string calldata geohash, uint256 delegatorQueryFeeCut) | ||
external | ||
override | ||
{ | ||
// Get provision from Staking contract | ||
// Validate provision parameters meet DS requirements | ||
} | ||
|
||
function _register(address provisionId, string calldata url, string calldata geohash, uint256 delegatorQueryFeeCut) | ||
internal | ||
{} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/subgraph-service/contracts/SubgraphServiceStorage.sol
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,4 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.25; | ||
|
||
contract SubgraphServiceV1Storage {} |
Submodule forge-std
updated
27 files
+0 −3 | .gitmodules | |
+1 −1 | README.md | |
+1 −1 | foundry.toml | |
+0 −1 | lib/ds-test | |
+1 −1 | scripts/vm.py | |
+518 −225 | src/StdAssertions.sol | |
+3 −1 | src/StdChains.sol | |
+7 −11 | src/StdJson.sol | |
+201 −106 | src/StdStorage.sol | |
+179 −0 | src/StdToml.sol | |
+4 −4 | src/Test.sol | |
+525 −1 | src/Vm.sol | |
+51 −33 | src/mocks/MockERC20.sol | |
+46 −32 | src/mocks/MockERC721.sol | |
+39 −909 | test/StdAssertions.t.sol | |
+29 −24 | test/StdChains.t.sol | |
+18 −10 | test/StdCheats.t.sol | |
+49 −0 | test/StdJson.t.sol | |
+8 −8 | test/StdMath.t.sol | |
+159 −11 | test/StdStorage.t.sol | |
+49 −0 | test/StdToml.t.sol | |
+18 −18 | test/StdUtils.t.sol | |
+3 −3 | test/Vm.t.sol | |
+8 −0 | test/fixtures/test.json | |
+6 −0 | test/fixtures/test.toml | |
+1 −1 | test/mocks/MockERC20.t.sol | |
+1 −1 | test/mocks/MockERC721.t.sol |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.