Skip to content

Commit

Permalink
feat: sonic (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoslr authored Jan 23, 2025
1 parent 541f68f commit 3c2a16b
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "sepolia"
- "xdai"
- "zksyncera"
- "sonic"
environment:
name: ${{ matrix.chain }}
url: ${{ format('https://api.studio.thegraph.com/query/67444/request-payments-{0}/version/latest', matrix.chain) }}
Expand Down
4 changes: 2 additions & 2 deletions cli/lib/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ethConversionArtifact,
erc20EscrowToPayArtifact,
erc20TransferableReceivableArtifact,
singleRequestProxyFactoryArtifact,
singleRequestForwarderFactoryArtifact,
} from "@requestnetwork/smart-contracts";
import { EventFragment } from "@ethersproject/abi";
import { camelCase } from "lodash";
Expand All @@ -25,7 +25,7 @@ const paymentNetworks = {
EthConversionProxy: ethConversionArtifact,
ERC20EscrowToPay: erc20EscrowToPayArtifact,
ERC20TransferrableReceivable: erc20TransferableReceivableArtifact,
SingleRequestProxyFactory: singleRequestProxyFactoryArtifact,
SingleRequestProxyFactory: singleRequestForwarderFactoryArtifact,
};

type DataSource = {
Expand Down
3 changes: 2 additions & 1 deletion cli/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"sepolia",
"tombchain",
"xdai",
"zksyncera"
"zksyncera",
"sonic"
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-ts": "^0.35.1",
"@requestnetwork/smart-contracts": "0.38.1-next.2087",
"@requestnetwork/smart-contracts": "0.45.1-next.0",
"graphql-request": "^3.5.0",
"ipfs-only-hash": "^4.0.0",
"lodash": "^4.17.21"
Expand Down
21 changes: 21 additions & 0 deletions subgraph.sepolia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,27 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20EscrowToPay.ts
- kind: ethereum/contract
name: ERC20TransferrableReceivable_0_2_0
network: sepolia
source:
address: "0xB5E53C3d145Cbaa61C7028736A1fF0bC6817A4c5"
abi: ERC20TransferrableReceivable_0_2_0
startBlock: 6194071
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: ERC20TransferrableReceivable_0_2_0
file: ./abis/ERC20TransferrableReceivable-0.2.0.json
eventHandlers:
- event: TransferWithReferenceAndFee(address,address,uint256,indexed bytes,uint256,address)
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20TransferrableReceivable.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: sepolia
Expand Down
135 changes: 135 additions & 0 deletions subgraph.sonic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
specVersion: 0.0.5
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: ERC20Proxy
network: sonic
source:
address: "0xC8D3FE2A27bB69a85F6973081FdC41103E107595"
abi: ERC20Proxy
startBlock: 3974125
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: ERC20Proxy
file: ./abis/ERC20Proxy.json
eventHandlers:
- event: TransferWithReference(address,address,uint256,indexed bytes)
handler: handleTransferWithReference
receipt: true
file: ./src/erc20Proxy.ts
- kind: ethereum/contract
name: ERC20FeeProxy_0_2_0
network: sonic
source:
address: "0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE"
abi: ERC20FeeProxy_0_2_0
startBlock: 3974138
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: ERC20ConversionProxy
network: sonic
source:
address: "0xe43fd55Da253628Ed7Cad5ab198664F5B3659DA9"
abi: ERC20ConversionProxy
startBlock: 3974151
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: ERC20ConversionProxy
file: ./abis/ERC20ConversionProxy.json
eventHandlers:
- event: TransferWithConversionAndReference(uint256,address,indexed bytes,uint256,uint256)
handler: handleTransferWithConversionAndReference
- event: TransferWithReferenceAndFee(address,address,uint256,indexed bytes,uint256,address)
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20ConversionProxy.ts
- kind: ethereum/contract
name: EthProxy_0_3_0
network: sonic
source:
address: "0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e"
abi: EthProxy_0_3_0
startBlock: 3974083
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: EthProxy_0_3_0
file: ./abis/EthProxy-0.3.0.json
eventHandlers:
- event: TransferWithReference(address,uint256,indexed bytes)
handler: handleTransferWithReference
receipt: true
file: ./src/ethProxy.ts
- kind: ethereum/contract
name: EthFeeProxy_0_2_0
network: sonic
source:
address: "0x4989F941D62bEEb3548Bf55d0D5291Ec335429f0"
abi: EthFeeProxy_0_2_0
startBlock: 3974098
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
- kind: ethereum/contract
name: EthConversionProxy_0_2_0
network: sonic
source:
address: "0x3E3B04e1bF170522a5c5DDE628C4d365c0342239"
abi: EthConversionProxy_0_2_0
startBlock: 3974113
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Payment
abis:
- name: EthConversionProxy_0_2_0
file: ./abis/EthConversionProxy-0.2.0.json
eventHandlers:
- event: TransferWithConversionAndReference(uint256,address,indexed bytes,uint256,uint256)
handler: handleTransferWithConversionAndReference
- event: TransferWithReferenceAndFee(address,uint256,indexed bytes,uint256,address)
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts

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

"@requestnetwork/smart-contracts@^0.38.1-next.2087":
version "0.38.1-next.2087"
resolved "https://registry.yarnpkg.com/@requestnetwork/smart-contracts/-/smart-contracts-0.38.1-next.2087.tgz#980eaafff1f92d26bdd4eb485993015f0d37f371"
integrity sha512-PBO1cTWap+0ye7Tget41piQy9M41AvGqSq3afhbDcTWxQV2i8OTy0fAdPHWeWPWPJh0PqVAmefT92qXDgJpYnQ==
"@requestnetwork/smart-contracts@0.45.1-next.0":
version "0.45.1-next.0"
resolved "https://registry.yarnpkg.com/@requestnetwork/smart-contracts/-/smart-contracts-0.45.1-next.0.tgz#a79c153415e1d71ed2dca8f842885df21ebb6c8f"
integrity sha512-9kQYWFpVm3CFTi+dokyRh1EwMMCOvUuqKl2y2+9QX55EbDiDH1ziKo2bnGZKv1qk2ovFWhJVFNBWL9xav7yVpA==
dependencies:
tslib "2.5.0"

Expand Down

0 comments on commit 3c2a16b

Please sign in to comment.