Skip to content

Commit

Permalink
feat: improve single request proxy (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
aimensahnoun authored Nov 11, 2024
1 parent ac12613 commit 1d6ee60
Show file tree
Hide file tree
Showing 15 changed files with 316 additions and 7 deletions.
38 changes: 37 additions & 1 deletion abis/SingleRequestProxyFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@
"internalType": "bytes",
"name": "paymentReference",
"type": "bytes"
},
{
"indexed": false,
"internalType": "address",
"name": "feeAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "feeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "feeProxyUsed",
"type": "address"
}
],
"name": "ERC20SingleRequestProxyCreated",
Expand Down Expand Up @@ -97,6 +115,24 @@
"internalType": "bytes",
"name": "paymentReference",
"type": "bytes"
},
{
"indexed": false,
"internalType": "address",
"name": "feeAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "feeAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "feeProxyUsed",
"type": "address"
}
],
"name": "EthereumSingleRequestProxyCreated",
Expand Down Expand Up @@ -279,4 +315,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
3 changes: 3 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ type SingleRequestProxyDeployment @entity {
tokenAddress: Bytes
paymentReference: Bytes!
proxyType: SingleRequestProxyType!
feeAddress: Bytes!
feeAmount: BigInt!
feeProxyUsed: Bytes!
block: Int!
timestamp: Int!
txHash: Bytes!
Expand Down
10 changes: 8 additions & 2 deletions src/singleRequestProxyFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ export function handleEthereumSingleRequestProxyCreated(
event: EthereumSingleRequestProxyCreated,
): void {
let deployment = new SingleRequestProxyDeployment(
event.transaction.hash.toHexString(),
event.transaction.hash.toHexString() + "-" + event.logIndex.toString(),
);
deployment.proxyAddress = event.params.proxyAddress;
deployment.payee = event.params.payee;
deployment.paymentReference = event.params.paymentReference;
deployment.feeAddress = event.params.feeAddress;
deployment.feeAmount = event.params.feeAmount;
deployment.feeProxyUsed = event.params.feeProxyUsed;
deployment.proxyType = "Ethereum";
deployment.block = event.block.number.toI32();
deployment.timestamp = event.block.timestamp.toI32();
Expand All @@ -24,12 +27,15 @@ export function handleERC20SingleRequestProxyCreated(
event: ERC20SingleRequestProxyCreated,
): void {
let deployment = new SingleRequestProxyDeployment(
event.transaction.hash.toHexString(),
event.transaction.hash.toHexString() + "-" + event.logIndex.toString(),
);
deployment.proxyAddress = event.params.proxyAddress;
deployment.payee = event.params.payee;
deployment.tokenAddress = event.params.tokenAddress;
deployment.paymentReference = event.params.paymentReference;
deployment.feeAddress = event.params.feeAddress;
deployment.feeAmount = event.params.feeAmount;
deployment.feeProxyUsed = event.params.feeProxyUsed;
deployment.proxyType = "ERC20";
deployment.block = event.block.number.toI32();
deployment.timestamp = event.block.timestamp.toI32();
Expand Down
24 changes: 24 additions & 0 deletions subgraph.arbitrum-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: arbitrum-one
source:
address: "0x4D417AA04DBb207201a794E5B7381B3cde815281"
abi: SingleRequestProxyFactory
startBlock: 272440350
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.avalanche.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: avalanche
source:
address: "0x4D417AA04DBb207201a794E5B7381B3cde815281"
abi: SingleRequestProxyFactory
startBlock: 52824404
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: base
source:
address: "0xAdc0001eA67Ab36D5321612c6b500572704fFF20"
abi: SingleRequestProxyFactory
startBlock: 22154500
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.bsc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: bsc
source:
address: "0x4D417AA04DBb207201a794E5B7381B3cde815281"
abi: SingleRequestProxyFactory
startBlock: 43839939
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.celo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethConversionProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: celo
source:
address: "0x8d996a0591a0F9eB65301592C88303e07Ec481db"
abi: SingleRequestProxyFactory
startBlock: 28685655
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20TransferrableReceivable.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: mainnet
source:
address: "0xD5933C74414ce80D9d7082cc89FBAdcfF4751fAF"
abi: SingleRequestProxyFactory
startBlock: 21145968
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.mantle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,27 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/ethFeeProxy.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: mantle
source:
address: "0xf8cACE7EE4c03Eb4f225434B0709527938D365b4"
abi: SingleRequestProxyFactory
startBlock: 71485828
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts
24 changes: 24 additions & 0 deletions subgraph.matic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20TransferrableReceivable.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: matic
source:
address: "0x4D417AA04DBb207201a794E5B7381B3cde815281"
abi: SingleRequestProxyFactory
startBlock: 64048143
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

24 changes: 24 additions & 0 deletions subgraph.optimism.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,28 @@ dataSources:
handler: handleTransferWithReferenceAndFee
receipt: true
file: ./src/erc20EscrowToPay.ts
- kind: ethereum/contract
name: SingleRequestProxyFactory
network: optimism
source:
address: "0xf8cACE7EE4c03Eb4f225434B0709527938D365b4"
abi: SingleRequestProxyFactory
startBlock: 127750366
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- SingleRequestProxyDeployment
abis:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts

8 changes: 4 additions & 4 deletions subgraph.sepolia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ dataSources:
name: SingleRequestProxyFactory
network: sepolia
source:
address: "0x435E81E12136414e2c09cAFe05E902E23bD46030"
address: "0xf8cACE7EE4c03Eb4f225434B0709527938D365b4"
abi: SingleRequestProxyFactory
startBlock: 6965557
startBlock: 7038199
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -181,10 +181,10 @@ dataSources:
- name: SingleRequestProxyFactory
file: ./abis/SingleRequestProxyFactory.json
eventHandlers:
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes)
- event: ERC20SingleRequestProxyCreated(address,address,address,indexed bytes,address,uint256,address)
handler: handleERC20SingleRequestProxyCreated
receipt: true
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes)
- event: EthereumSingleRequestProxyCreated(address,address,indexed bytes,address,uint256,address)
handler: handleEthereumSingleRequestProxyCreated
receipt: true
file: ./src/singleRequestProxyFactory.ts
Expand Down
Loading

0 comments on commit 1d6ee60

Please sign in to comment.