-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subgraph updates for BIP-48 wstETH Migration (#964)
- Loading branch information
Showing
26 changed files
with
405 additions
and
225 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,17 @@ | ||
// Unfortunately this file must be copied across the various subgraph projects. This is due to the codegen | ||
import { Address, BigInt } from "@graphprotocol/graph-ts"; | ||
import { BeanstalkPrice } from "../../generated/templates/Well/BeanstalkPrice"; | ||
import { BEANSTALK_PRICE_1, BEANSTALK_PRICE_2, PRICE_2_BLOCK } from "../../../subgraph-core/utils/Constants"; | ||
|
||
// Gets the BeanstalkPrice contract, bound to the appropriate instance of the contract. | ||
// Note: Will bind to PRICE_1 even if that contract has not been deployed yet | ||
// Thus the caller still needs to check for reverts. | ||
export function getBeanstalkPrice(blockNumber: BigInt): BeanstalkPrice { | ||
let contractAddress: Address; | ||
if (blockNumber < PRICE_2_BLOCK) { | ||
contractAddress = BEANSTALK_PRICE_1; | ||
} else { | ||
contractAddress = BEANSTALK_PRICE_2; | ||
} | ||
return BeanstalkPrice.bind(contractAddress); | ||
} |
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
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,6 +1,25 @@ | ||
<img src="https://github.com/BeanstalkFarms/Beanstalk-Brand-Assets/blob/main/BEAN/bean-128x128.png" alt="Beanstalk logo" align="right" width="120" /> | ||
|
||
# Bean Subgraph | ||
## Beanstalk Subgraph | ||
|
||
The Bean subgraph can be found here: | ||
https://thegraph.com/explorer/subgraph?id=0x925753106fcdb6d2f30c3db295328a0a1c5fd1d1-1 | ||
[![Discord][discord-badge]][discord-url] | ||
|
||
[discord-badge]: https://img.shields.io/discord/880413392916054098?label=Beanstalk | ||
[discord-url]: https://discord.gg/beanstalk | ||
|
||
**Indexes events emitted by [Beanstalk](https://etherscan.io/address/0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5) and its trading pools.** | ||
|
||
### Subgraphs | ||
|
||
All currently used subgraphs live on a centralized host controlled by beanstalk farms. | ||
|
||
- [Testing Subgraph](https://graph.node.bean.money/subgraphs/name/bean-testing) | ||
- Used during local development for debugging and rapid iteration. | ||
- [Dev Subgraph](https://graph.node.bean.money/subgraphs/name/bean-dev) | ||
- Used for testing fixes or improvements made in the testing subgraph. | ||
- [Canonical Subgraph](https://graph.node.bean.money/subgraphs/name/bean) | ||
- Stable deployment and current source of truth for UI and other production processes. | ||
|
||
### Testing | ||
|
||
To test with Docker, the first time you will need to run `yarn run graph test -d`. This will build the `matchstick` Docker image. Then, you can use the `yarn testd` script to run all tests. Alternatively, use `yarn testd-named <TestName1> ...` to run specific tests. I have found running in Docker to be preferred since otherwise there can be issues with console output and some test cases fail silently. |
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
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
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
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
Oops, something went wrong.