Skip to content

Commit

Permalink
Add contract addresses for FxPortal events
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Sep 28, 2021
1 parent 5cb0a81 commit 7adb07e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions root/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type TokenMapping @entity {
type FxTokenMapping @entity {
id: ID!
counter: BigInt!
contractAddress: Bytes!
rootToken: Bytes!
childToken: Bytes!
tokenType: String!
Expand All @@ -94,6 +95,7 @@ type FxTokenMappingCounter @entity {
type FxDeposit @entity {
id: ID!
counter: BigInt!
contractAddress: Bytes!
rootToken: Bytes!
tokenType: String!
depositor: Bytes!
Expand All @@ -112,6 +114,7 @@ type FxDepositCounter @entity {
type FxWithdraw @entity {
id: ID!
counter: BigInt!
contractAddress: Bytes!
rootToken: Bytes!
childToken: Bytes!
tokenType: String!
Expand Down
3 changes: 3 additions & 0 deletions root/src/mappings/fx-erc1155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function handleTokenMappedERC1155(event: TokenMappedERC1155): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC1155'
Expand All @@ -87,6 +88,7 @@ export function handleFxDepositERC1155(event: FxDepositERC1155): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.tokenType = 'ERC1155'
entity.userAddress = event.params.userAddress
Expand Down Expand Up @@ -116,6 +118,7 @@ export function handleFxWithdrawERC1155(event: FxWithdrawERC1155): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC1155'
Expand Down
3 changes: 3 additions & 0 deletions root/src/mappings/fx-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function handleTokenMappedERC20(event: TokenMappedERC20): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC20'
Expand All @@ -87,6 +88,7 @@ export function handleFxDepositERC20(event: FxDepositERC20): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.tokenType = 'ERC20'
entity.userAddress = event.params.userAddress
Expand Down Expand Up @@ -115,6 +117,7 @@ export function handleFxWithdrawERC20(event: FxWithdrawERC20): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC20'
Expand Down
3 changes: 3 additions & 0 deletions root/src/mappings/fx-erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function handleTokenMappedERC721(event: TokenMappedERC721): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC721'
Expand All @@ -87,6 +88,7 @@ export function handleFxDepositERC721(event: FxDepositERC721): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.tokenType = 'ERC721'
entity.userAddress = event.params.userAddress
Expand Down Expand Up @@ -115,6 +117,7 @@ export function handleFxWithdrawERC721(event: FxWithdrawERC721): void {
entity.transactionHash = event.transaction.hash
entity.timestamp = event.block.timestamp
entity.counter = counter.current
entity.contractAddress = event.address
entity.rootToken = event.params.rootToken
entity.childToken = event.params.childToken
entity.tokenType = 'ERC721'
Expand Down

0 comments on commit 7adb07e

Please sign in to comment.