Skip to content

Commit

Permalink
Subgraph (#375)
Browse files Browse the repository at this point in the history
See subgraph/README.md for instructions on how to deploy the subgraph locally.

- Add `subgraph/` to the workspaces.
- A script, `./deploy-subgraph`, can be used to deploy the subgraph in a
  convenient way. See `--help` for details.

Some context:

- The subgraph uses data source templates [1] for the collateral contracts.
- The script can update the collateral registry address in the
  `subgraph.yaml` if it doesn’t match the one found in the latest
  deployment context.
- In `./deploy-subgraph`, only the local preset is implemented for now.

[1] https://thegraph.com/docs/en/developing/creating-a-subgraph/#data-source-templates
  • Loading branch information
bpierre committed Sep 24, 2024
1 parent 270a251 commit 4fcc30f
Show file tree
Hide file tree
Showing 16 changed files with 2,142 additions and 97 deletions.
24 changes: 12 additions & 12 deletions contracts/src/scripts/DeployLiquity2.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ contract DeployLiquity2Script is Script, StdCheats, MetadataDeployment {
demoTroves[6] = DemoTroveParams(0, demoAccounts[6], 0, 33.92e18, 5500e18, 3.8e16);
demoTroves[7] = DemoTroveParams(0, demoAccounts[7], 0, 47.2e18, 6000e18, 4.3e16);

demoTroves[8] = DemoTroveParams(1, demoAccounts[0], 0, 21e18, 2000e18, 3.3e16);
demoTroves[8] = DemoTroveParams(1, demoAccounts[0], 1, 21e18, 2000e18, 3.3e16);
demoTroves[9] = DemoTroveParams(1, demoAccounts[1], 1, 16e18, 2000e18, 4.1e16);
demoTroves[10] = DemoTroveParams(1, demoAccounts[2], 1, 18e18, 2300e18, 3.8e16);
demoTroves[11] = DemoTroveParams(1, demoAccounts[3], 1, 22e18, 2200e18, 4.3e16);
Expand Down Expand Up @@ -274,17 +274,17 @@ contract DeployLiquity2Script is Script, StdCheats, MetadataDeployment {
}

IBorrowerOperations(contracts.borrowerOperations).openTrove(
vm.addr(trove.owner), // _owner
trove.ownerIndex, // _ownerIndex
trove.coll, // _collAmount
trove.debt, // _boldAmount
0, // _upperHint
0, // _lowerHint
0.05e18, // _annualInterestRate
type(uint256).max, // _maxUpfrontFee
address(0), // _addManager
address(0), // _removeManager
address(0) // _receiver
vm.addr(trove.owner), // _owner
trove.ownerIndex, // _ownerIndex
trove.coll, // _collAmount
trove.debt, // _boldAmount
0, // _upperHint
0, // _lowerHint
trove.annualInterestRate, // _annualInterestRate
type(uint256).max, // _maxUpfrontFee
address(0), // _addManager
address(0), // _removeManager
address(0) // _receiver
);

vm.stopBroadcast();
Expand Down
5 changes: 3 additions & 2 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"json": {},
"markdown": {},
"toml": {},
"includes": ["**/*.{ts,tsx,js,jsx,mjs,json,md,html,css}"],
"includes": ["**/*.{ts,tsx,js,jsx,mjs,json,md,html,css,graphql}"],
"excludes": [
"**/node_modules",
"**/*-lock.json",
Expand All @@ -20,6 +20,7 @@
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/toml-0.6.1.wasm",
"https://plugins.dprint.dev/g-plane/malva-v0.1.5.wasm"
"https://plugins.dprint.dev/g-plane/malva-v0.1.5.wasm",
"https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.0.wasm"
]
}
Loading

0 comments on commit 4fcc30f

Please sign in to comment.