Skip to content

Commit

Permalink
feat: zksync subgraph (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
KolevDarko authored Nov 27, 2023
1 parent eab32ca commit 2fae513
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ For decentralized network, use:
yarn graph deploy --studio request-payments-<network> ./subgraph.<network>.yaml --version-label v1.<bumped-version>
```

#### Manual Deployment of zkSync Era

The network zkSync Era is only supported by The Graph's Subgraph Studio so the deployment is different.

Step 1: Authenticate the graph-cli with subgraph studio. Get the studio token (here)[https://thegraph.com/studio/subgraph/request-payment-zksyncera/]
```
graph auth --studio <studio token>
```
Step 2: Deploy to subgraph studio
```
graph deploy --studio request-payment-zksyncera subgraph.zksyncera.yaml
```

### Check the deployed version

You can compare the code to the deployed version using one of these commands
Expand Down
3 changes: 2 additions & 1 deletion cli/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"optimism",
"moonbeam",
"tombchain",
"core"
"core",
"zksync-era"
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@graphprotocol/graph-cli": "^0.54.0",
"@graphprotocol/graph-ts": "^0.27.0",
"@requestnetwork/smart-contracts": "0.30.1-next.1944",
"@requestnetwork/smart-contracts": "0.31.1-next.1963",
"graphql-request": "^3.5.0",
"ipfs-only-hash": "^4.0.0",
"lodash": "^4.17.21"
Expand Down
47 changes: 47 additions & 0 deletions subgraph.zksyncera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
specVersion: 0.0.5
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: ERC20FeeProxy_0_2_0
network: zksync-era
source:
address: "0x6e28Cc56C2E64c9250f39Cb134686C87dB196532"
abi: ERC20FeeProxy_0_2_0
startBlock: 19545285
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: ERC20FeeProxy_0_2_0
file: ./abis/ERC20FeeProxy-0.2.0.json
eventHandlers:
- event: TransferWithReferenceAndFee(address,address,uint256,indexed bytes,uint256,address)
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20FeeProxy.ts
- kind: ethereum/contract
name: EthFeeProxy_0_2_0
network: zksync-era
source:
address: "0xE9A708db0D30409e39810C44cA240fd15cdA9b1a"
abi: EthFeeProxy_0_2_0
startBlock: 19545294
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: EthFeeProxy_0_2_0
file: ./abis/EthFeeProxy-0.2.0.json
eventHandlers:
- event: TransferWithReferenceAndFee(address,uint256,indexed bytes,uint256,address)
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethFeeProxy.ts

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,10 @@
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==

"@requestnetwork/smart-contracts@0.30.1-next.1944":
version "0.30.1-next.1944"
resolved "https://registry.yarnpkg.com/@requestnetwork/smart-contracts/-/smart-contracts-0.30.1-next.1944.tgz#bf449f554f7e3f22286c1a2c5ff607e6fd8edc0b"
integrity sha512-atO7Wi+iuyZHzDFtZ8Y/noPrqLi28GOo3P+P3LgS12VfL0e4SzVK4O545deBpz5oiwlFlH6oKYQlkLKO3x2NOQ==
"@requestnetwork/smart-contracts@0.31.1-next.1963":
version "0.31.1-next.1963"
resolved "https://registry.yarnpkg.com/@requestnetwork/smart-contracts/-/smart-contracts-0.31.1-next.1963.tgz#a4d7102f876bf99dacf6ede0ffb29c3827c0814a"
integrity sha512-Gy72xjKS6TOS6OHchaOAyLc/pM2nZkrOjqRHDqmF+IWCvCjOIhBUFE2LTHHHV876Ijegk1v8LlzHUusDE2zyOA==
dependencies:
tslib "2.5.0"

Expand Down

0 comments on commit 2fae513

Please sign in to comment.