From 3c2a16b458ef599f03c5878e938457e0b42bd25e Mon Sep 17 00:00:00 2001 From: leoslr <50319677+leoslr@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:05:45 +0100 Subject: [PATCH] feat: sonic (#109) --- .github/workflows/deploy.yaml | 1 + cli/lib/manifest.ts | 4 +- cli/networks.json | 3 +- package.json | 2 +- subgraph.sepolia.yaml | 21 ++++++ subgraph.sonic.yaml | 135 ++++++++++++++++++++++++++++++++++ yarn.lock | 8 +- 7 files changed, 166 insertions(+), 8 deletions(-) create mode 100644 subgraph.sonic.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b69879a..9c9cd74 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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) }} diff --git a/cli/lib/manifest.ts b/cli/lib/manifest.ts index 4a4e6d9..f8d6cba 100644 --- a/cli/lib/manifest.ts +++ b/cli/lib/manifest.ts @@ -11,7 +11,7 @@ import { ethConversionArtifact, erc20EscrowToPayArtifact, erc20TransferableReceivableArtifact, - singleRequestProxyFactoryArtifact, + singleRequestForwarderFactoryArtifact, } from "@requestnetwork/smart-contracts"; import { EventFragment } from "@ethersproject/abi"; import { camelCase } from "lodash"; @@ -25,7 +25,7 @@ const paymentNetworks = { EthConversionProxy: ethConversionArtifact, ERC20EscrowToPay: erc20EscrowToPayArtifact, ERC20TransferrableReceivable: erc20TransferableReceivableArtifact, - SingleRequestProxyFactory: singleRequestProxyFactoryArtifact, + SingleRequestProxyFactory: singleRequestForwarderFactoryArtifact, }; type DataSource = { diff --git a/cli/networks.json b/cli/networks.json index be8d82a..6c7e197 100644 --- a/cli/networks.json +++ b/cli/networks.json @@ -18,5 +18,6 @@ "sepolia", "tombchain", "xdai", - "zksyncera" + "zksyncera", + "sonic" ] diff --git a/package.json b/package.json index 36a194d..d44e612 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/subgraph.sepolia.yaml b/subgraph.sepolia.yaml index acc8c6a..eaaf002 100644 --- a/subgraph.sepolia.yaml +++ b/subgraph.sepolia.yaml @@ -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 diff --git a/subgraph.sonic.yaml b/subgraph.sonic.yaml new file mode 100644 index 0000000..cbd2758 --- /dev/null +++ b/subgraph.sonic.yaml @@ -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 + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 8be683f..cc595eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"