diff --git a/packages/explorer-ui/components/ChainChart/index.tsx b/packages/explorer-ui/components/ChainChart/index.tsx index a99f02dbb7..35ae42acb6 100644 --- a/packages/explorer-ui/components/ChainChart/index.tsx +++ b/packages/explorer-ui/components/ChainChart/index.tsx @@ -320,6 +320,12 @@ export const OverviewChart: React.FC = ({ stackId="a" fill={loading ? 'rgba(255, 255, 255, 0.1)' : '#000000'} /> + )} diff --git a/packages/rfq-indexer/api/src/constants/networkConfig.ts b/packages/rfq-indexer/api/src/constants/networkConfig.ts index 8d2dc78e3f..579f8f7273 100644 --- a/packages/rfq-indexer/api/src/constants/networkConfig.ts +++ b/packages/rfq-indexer/api/src/constants/networkConfig.ts @@ -8,6 +8,7 @@ import { linea, bsc, blast, + worldchain, } from 'viem/chains' import { FastBridgeV2Abi } from './abis/FastBridgeV2' @@ -114,4 +115,15 @@ export const networkConfig: NetworkConfig = { transport: http(), }), }, + 480: { + name: 'Worldchain', + FastBridgeV2: { + address: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', + abi: FastBridgeV2Abi, + }, + client: createPublicClient({ + chain: worldchain, + transport: http(), + }), + }, } as const diff --git a/packages/rfq-indexer/api/src/controllers/conflictingProofsController.ts b/packages/rfq-indexer/api/src/controllers/conflictingProofsController.ts index 7f1de3137a..879473b32e 100644 --- a/packages/rfq-indexer/api/src/controllers/conflictingProofsController.ts +++ b/packages/rfq-indexer/api/src/controllers/conflictingProofsController.ts @@ -13,7 +13,7 @@ export const conflictingProofsController = async ( const query = db .with('deposits', () => qDeposits()) .with('relays', () => qRelays()) - .with('proofs', () => qProofs({activeOnly: true})) + .with('proofs', () => qProofs({ activeOnly: true })) .with('combined', (qb) => qb .selectFrom('deposits') diff --git a/packages/rfq-indexer/api/src/controllers/disputesController.ts b/packages/rfq-indexer/api/src/controllers/disputesController.ts index 2e65632c77..840d133db8 100644 --- a/packages/rfq-indexer/api/src/controllers/disputesController.ts +++ b/packages/rfq-indexer/api/src/controllers/disputesController.ts @@ -7,7 +7,7 @@ import { nest_results } from '../utils/nestResults' export const disputesController = async (req: Request, res: Response) => { try { const query = db - .with('disputes', () => qDisputes({activeOnly: true})) + .with('disputes', () => qDisputes({ activeOnly: true })) .selectFrom('disputes') .selectAll() .orderBy('blockTimestamp_dispute', 'desc') diff --git a/packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts b/packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts index a2012c53c4..5d235e92cc 100644 --- a/packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts +++ b/packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts @@ -1,14 +1,7 @@ import { Request, Response } from 'express' import { db } from '../db' -import { - qDeposits, - qRelays, - qProofs, - qClaims, - qRefunds, - qDisputes, -} from '../queries' +import { qDeposits, qRelays, qProofs, qClaims, qRefunds } from '../queries' import { nest_results } from '../utils/nestResults' const sevenDaysAgo = Math.floor(Date.now() / 1000) - 7 * 24 * 60 * 60 @@ -21,7 +14,7 @@ export const pendingTransactionsMissingClaimController = async ( const query = db .with('deposits', () => qDeposits()) .with('relays', () => qRelays()) - .with('proofs', () => qProofs({activeOnly: true})) + .with('proofs', () => qProofs({ activeOnly: true })) .with('claims', () => qClaims()) .with('combined', (qb) => qb @@ -45,7 +38,7 @@ export const pendingTransactionsMissingClaimController = async ( res.json(nestedResults) } else { res - .status(404) + .status(200) .json({ message: 'No pending transactions missing claim found' }) } } catch (error) { @@ -62,7 +55,7 @@ export const pendingTransactionsMissingProofController = async ( const query = db .with('deposits', () => qDeposits()) .with('relays', () => qRelays()) - .with('proofs', () => qProofs({activeOnly: true})) + .with('proofs', () => qProofs({ activeOnly: true })) .with('combined', (qb) => qb .selectFrom('deposits') @@ -83,7 +76,7 @@ export const pendingTransactionsMissingProofController = async ( res.json(nestedResults) } else { res - .status(404) + .status(200) .json({ message: 'No pending transactions missing proof found' }) } } catch (error) { @@ -128,7 +121,7 @@ export const pendingTransactionsMissingRelayController = async ( res.json(nestedResults) } else { res - .status(404) + .status(200) .json({ message: 'No pending transactions missing relay found' }) } } catch (error) { @@ -173,7 +166,7 @@ export const pendingTransactionsMissingRelayExceedDeadlineController = async ( res.json(nestedResults) } else { res - .status(404) + .status(200) .json({ message: 'No pending transactions missing relay found' }) } } catch (error) { diff --git a/packages/rfq-indexer/api/src/controllers/transactionIdController.ts b/packages/rfq-indexer/api/src/controllers/transactionIdController.ts index 23f1496814..d5cafa23fa 100644 --- a/packages/rfq-indexer/api/src/controllers/transactionIdController.ts +++ b/packages/rfq-indexer/api/src/controllers/transactionIdController.ts @@ -1,7 +1,14 @@ import { Request, Response } from 'express' import { db } from '../db' -import { qDeposits, qRelays, qProofs, qClaims, qRefunds, qDisputes } from '../queries' +import { + qDeposits, + qRelays, + qProofs, + qClaims, + qRefunds, + qDisputes, +} from '../queries' import { nest_results } from '../utils/nestResults' export const getTransactionById = async (req: Request, res: Response) => { @@ -18,8 +25,8 @@ export const getTransactionById = async (req: Request, res: Response) => { ) ) .with('relays', () => qRelays()) - .with('proofs', () => qProofs({activeOnly: false})) // display proofs even if they have been invalidated/replaced by a dispute - .with('disputes', () => qDisputes({activeOnly: true})) // do not show disputes that have been invalidated/replaced by a proof + .with('proofs', () => qProofs({ activeOnly: false })) // display proofs even if they have been invalidated/replaced by a dispute + .with('disputes', () => qDisputes({ activeOnly: true })) // do not show disputes that have been invalidated/replaced by a proof .with('claims', () => qClaims()) .with('refunds', () => qRefunds()) .with('combined', (qb) => @@ -27,7 +34,11 @@ export const getTransactionById = async (req: Request, res: Response) => { .selectFrom('deposits') .leftJoin('relays', 'transactionId_deposit', 'transactionId_relay') .leftJoin('proofs', 'transactionId_deposit', 'transactionId_proof') - .leftJoin('disputes', 'transactionId_deposit', 'transactionId_dispute') + .leftJoin( + 'disputes', + 'transactionId_deposit', + 'transactionId_dispute' + ) .leftJoin('claims', 'transactionId_deposit', 'transactionId_claim') .leftJoin('refunds', 'transactionId_deposit', 'transactionId_refund') .selectAll('deposits') diff --git a/packages/rfq-indexer/api/src/graphql/resolvers.ts b/packages/rfq-indexer/api/src/graphql/resolvers.ts index 1deb7950d9..b346371ec7 100644 --- a/packages/rfq-indexer/api/src/graphql/resolvers.ts +++ b/packages/rfq-indexer/api/src/graphql/resolvers.ts @@ -20,6 +20,7 @@ const qDeposits = () => { 'BridgeRequestEvents.originAmountFormatted', 'BridgeRequestEvents.destAmountFormatted', 'BridgeRequestEvents.sender', + 'BridgeRequestEvents.request', 'BridgeRequestEvents.sendChainGas', ]) .where('BridgeRequestEvents.blockTimestamp', '>', 1722729600) diff --git a/packages/rfq-indexer/api/src/graphql/types/events.graphql b/packages/rfq-indexer/api/src/graphql/types/events.graphql index 2e3716de0e..45fcf930db 100644 --- a/packages/rfq-indexer/api/src/graphql/types/events.graphql +++ b/packages/rfq-indexer/api/src/graphql/types/events.graphql @@ -17,6 +17,7 @@ scalar BigInt destAmountFormatted: String! destChainId: Int! destChain: String! + request: String! sendChainGas: Boolean! } diff --git a/packages/rfq-indexer/api/src/queries/depositsQueries.ts b/packages/rfq-indexer/api/src/queries/depositsQueries.ts index 61e33aa3d1..e765e032d5 100644 --- a/packages/rfq-indexer/api/src/queries/depositsQueries.ts +++ b/packages/rfq-indexer/api/src/queries/depositsQueries.ts @@ -17,6 +17,7 @@ export const qDeposits = () => { 'BridgeRequestEvents.originAmountFormatted', 'BridgeRequestEvents.destAmountFormatted', 'BridgeRequestEvents.sender', + 'BridgeRequestEvents.request', 'BridgeRequestEvents.sendChainGas', ]) .where('BridgeRequestEvents.blockTimestamp', '>', 1722729600) diff --git a/packages/rfq-indexer/api/src/routes/conflictingProofsRoute.ts b/packages/rfq-indexer/api/src/routes/conflictingProofsRoute.ts index aa48c89e07..6ed5871c52 100644 --- a/packages/rfq-indexer/api/src/routes/conflictingProofsRoute.ts +++ b/packages/rfq-indexer/api/src/routes/conflictingProofsRoute.ts @@ -12,7 +12,7 @@ const router = express.Router() * description: Retrieves a list of transactions where the relayer in the proof differs from the relayer in the relay event * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array if no conflicting proofs found) * content: * application/json: * schema: @@ -41,15 +41,6 @@ const router = express.Router() * BridgeDispute: * type: object * description: Dispute information (if available) - * 404: - * description: No conflicting proofs found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: diff --git a/packages/rfq-indexer/api/src/routes/disputesRoute.ts b/packages/rfq-indexer/api/src/routes/disputesRoute.ts index de964220b0..bbb0b5ac83 100644 --- a/packages/rfq-indexer/api/src/routes/disputesRoute.ts +++ b/packages/rfq-indexer/api/src/routes/disputesRoute.ts @@ -12,7 +12,7 @@ const router = express.Router() * description: Retrieves a list of all active disputes * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -41,15 +41,6 @@ const router = express.Router() * BridgeDispute: * type: object * description: Dispute information (if available) - * 404: - * description: No disputes found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: diff --git a/packages/rfq-indexer/api/src/routes/invalidRelaysRoute.ts b/packages/rfq-indexer/api/src/routes/invalidRelaysRoute.ts index 31356156f2..44d2ecf8db 100644 --- a/packages/rfq-indexer/api/src/routes/invalidRelaysRoute.ts +++ b/packages/rfq-indexer/api/src/routes/invalidRelaysRoute.ts @@ -12,7 +12,7 @@ const router = express.Router() * description: Retrieves a list of recent invalid relay events from the past 2 weeks * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -41,15 +41,6 @@ const router = express.Router() * BridgeDispute: * type: object * description: Dispute information (if available) - * 404: - * description: No recent invalid relays found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: diff --git a/packages/rfq-indexer/api/src/routes/pendingTransactionsRoute.ts b/packages/rfq-indexer/api/src/routes/pendingTransactionsRoute.ts index e80dbd7fac..24922add1a 100644 --- a/packages/rfq-indexer/api/src/routes/pendingTransactionsRoute.ts +++ b/packages/rfq-indexer/api/src/routes/pendingTransactionsRoute.ts @@ -17,7 +17,7 @@ const router = express.Router() * description: Retrieves a list of transactions that have been deposited, relayed, and proven, but not yet claimed * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -46,15 +46,6 @@ const router = express.Router() * BridgeDispute: * type: object * description: Dispute information (if available) - * 404: - * description: No pending transactions missing claim found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: @@ -75,7 +66,7 @@ router.get('/missing-claim', pendingTransactionsMissingClaimController) * description: Retrieves a list of transactions that have been deposited and relayed, but not yet proven * responses: * 200: - * description: Successful response +* description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -87,15 +78,6 @@ router.get('/missing-claim', pendingTransactionsMissingClaimController) * type: object * relay: * type: object - * 404: - * description: No pending transactions missing proof found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: @@ -116,7 +98,7 @@ router.get('/missing-proof', pendingTransactionsMissingProofController) * description: Retrieves a list of transactions that have been deposited, but not yet relayed or refunded * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -126,15 +108,6 @@ router.get('/missing-proof', pendingTransactionsMissingProofController) * properties: * deposit: * type: object - * 404: - * description: No pending transactions missing relay found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: @@ -155,7 +128,7 @@ router.get('/missing-relay', pendingTransactionsMissingRelayController) * description: Retrieves a list of transactions that have been deposited, but not yet relayed or refunded and have exceeded the deadline * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -165,15 +138,6 @@ router.get('/missing-relay', pendingTransactionsMissingRelayController) * properties: * deposit: * type: object - * 404: - * description: No pending transactionst that exceed the deadline found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: diff --git a/packages/rfq-indexer/api/src/routes/refundedAndRelayedRoute.ts b/packages/rfq-indexer/api/src/routes/refundedAndRelayedRoute.ts index cd38b3b33e..f9ae80ad3b 100644 --- a/packages/rfq-indexer/api/src/routes/refundedAndRelayedRoute.ts +++ b/packages/rfq-indexer/api/src/routes/refundedAndRelayedRoute.ts @@ -12,7 +12,7 @@ const router = express.Router() * description: Retrieves a list of transactions that have been both refunded and relayed * responses: * 200: - * description: Successful response + * description: Successful response (may be an empty array) * content: * application/json: * schema: @@ -41,15 +41,6 @@ const router = express.Router() * BridgeDispute: * type: object * description: Dispute information (if available) - * 404: - * description: No refunded and relayed transactions found - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string * 500: * description: Server error * content: diff --git a/packages/rfq-indexer/api/src/routes/transactionIdRoute.ts b/packages/rfq-indexer/api/src/routes/transactionIdRoute.ts index 253060dcdf..4a85b6329b 100644 --- a/packages/rfq-indexer/api/src/routes/transactionIdRoute.ts +++ b/packages/rfq-indexer/api/src/routes/transactionIdRoute.ts @@ -8,15 +8,15 @@ const router = express.Router() * @openapi * /transaction-id/{transactionId}: * get: - * summary: Get transaction details by ID or the origin transaction hash - * description: Retrieves detailed information about a transaction, including deposit, relay, proof, claim, and refund data if available + * summary: Get transaction details by ID + * description: Retrieves details of a specific transaction by its ID * parameters: * - in: path * name: transactionId * required: true * schema: * type: string - * description: The unique identifier of the transaction or the origin transaction hash + * description: The ID of the transaction to retrieve * responses: * 200: * description: Successful response @@ -25,27 +25,27 @@ const router = express.Router() * schema: * type: object * properties: -* Bridge: -* type: object -* description: General transaction fields -* BridgeRequest: -* type: object -* description: Deposit information -* BridgeRelay: -* type: object -* description: Relay information -* BridgeRefund: -* type: object -* description: Refund information -* BridgeProof: -* type: object -* description: Proof information (if available) -* BridgeClaim: -* type: object -* description: Claim information (if available) -* BridgeDispute: -* type: object -* description: Dispute information (if available) + * Bridge: + * type: object + * description: General transaction fields + * BridgeRequest: + * type: object + * description: Deposit information + * BridgeRelay: + * type: object + * description: Relay information + * BridgeRefund: + * type: object + * description: Refund information + * BridgeProof: + * type: object + * description: Proof information (if available) + * BridgeClaim: + * type: object + * description: Claim information (if available) + * BridgeDispute: + * type: object + * description: Dispute information (if available) * 404: * description: Transaction not found * content: @@ -55,15 +55,6 @@ const router = express.Router() * properties: * message: * type: string - * 500: - * description: Server error - * content: - * application/json: - * schema: - * type: object - * properties: - * message: - * type: string */ router.get('/:transactionId', getTransactionById) diff --git a/packages/rfq-indexer/api/src/types/index.ts b/packages/rfq-indexer/api/src/types/index.ts index 738e9469fd..503563e741 100644 --- a/packages/rfq-indexer/api/src/types/index.ts +++ b/packages/rfq-indexer/api/src/types/index.ts @@ -10,6 +10,7 @@ export interface BridgeRequestEvents { originChainId: ColumnType originChain: ColumnType sender: ColumnType + request: ColumnType originToken: ColumnType destToken: ColumnType originAmount: ColumnType diff --git a/packages/rfq-indexer/indexer/.env.example b/packages/rfq-indexer/indexer/.env.example index 33ca569c2c..b1361bc84e 100644 --- a/packages/rfq-indexer/indexer/.env.example +++ b/packages/rfq-indexer/indexer/.env.example @@ -8,7 +8,7 @@ BLAST_MAINNET_RPC= SCROLL_MAINNET_RPC= LINEA_MAINNET_RPC= BNB_MAINNET_RPC= +WORLDCHAIN_MAINNET_RPC= # (Optional) Postgres database URL. If not provided, SQLite will be used. DATABASE_URL= - \ No newline at end of file diff --git a/packages/rfq-indexer/indexer/abis/FastBridgeV2.ts b/packages/rfq-indexer/indexer/abis/FastBridgeV2.ts index 5e355f84cc..fde30f002e 100644 --- a/packages/rfq-indexer/indexer/abis/FastBridgeV2.ts +++ b/packages/rfq-indexer/indexer/abis/FastBridgeV2.ts @@ -1,643 +1,774 @@ export const FastBridgeV2Abi = [ - { - inputs: [ - { internalType: 'address', name: '_owner', type: 'address' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'AccessControlBadConfirmation', - type: 'error', - }, - { - inputs: [ - { internalType: 'address', name: 'account', type: 'address' }, - { internalType: 'bytes32', name: 'neededRole', type: 'bytes32' }, - ], - name: 'AccessControlUnauthorizedAccount', - type: 'error', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - ], - name: 'AddressEmptyCode', - type: 'error', - }, - { - inputs: [ - { internalType: 'address', name: 'account', type: 'address' }, - ], - name: 'AddressInsufficientBalance', - type: 'error', - }, - { - inputs: [], - name: 'AmountIncorrect', - type: 'error', - }, - { - inputs: [], - name: 'ChainIncorrect', - type: 'error', - }, - { - inputs: [], - name: 'DeadlineExceeded', - type: 'error', - }, - { - inputs: [], - name: 'DeadlineNotExceeded', - type: 'error', - }, - { - inputs: [], - name: 'DeadlineTooShort', - type: 'error', - }, - { - inputs: [], - name: 'DisputePeriodNotPassed', - type: 'error', - }, - { - inputs: [], - name: 'DisputePeriodPassed', - type: 'error', - }, - { - inputs: [], - name: 'FailedInnerCall', - type: 'error', - }, - { - inputs: [], - name: 'MsgValueIncorrect', - type: 'error', - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - ], - name: 'SafeERC20FailedOperation', - type: 'error', - }, - { - inputs: [], - name: 'SenderIncorrect', - type: 'error', - }, - { - inputs: [], - name: 'StatusIncorrect', - type: 'error', - }, - { - inputs: [], - name: 'TokenNotContract', - type: 'error', - }, - { - inputs: [], - name: 'TransactionRelayed', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAddress', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'relayer', type: 'address' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { indexed: false, internalType: 'address', name: 'token', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'BridgeDepositClaimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { indexed: false, internalType: 'address', name: 'token', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'BridgeDepositRefunded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'relayer', type: 'address' }, - ], - name: 'BridgeProofDisputed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'relayer', type: 'address' }, - { indexed: false, internalType: 'bytes32', name: 'transactionHash', type: 'bytes32' }, - ], - name: 'BridgeProofProvided', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'relayer', type: 'address' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { indexed: false, internalType: 'uint32', name: 'originChainId', type: 'uint32' }, - { indexed: false, internalType: 'address', name: 'originToken', type: 'address' }, - { indexed: false, internalType: 'address', name: 'destToken', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'originAmount', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'destAmount', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'chainGasAmount', type: 'uint256' }, - ], - name: 'BridgeRelayed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'sender', type: 'address' }, - { indexed: false, internalType: 'bytes', name: 'request', type: 'bytes' }, - { indexed: false, internalType: 'uint32', name: 'destChainId', type: 'uint32' }, - { indexed: false, internalType: 'address', name: 'originToken', type: 'address' }, - { indexed: false, internalType: 'address', name: 'destToken', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'originAmount', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'destAmount', type: 'uint256' }, - { indexed: false, internalType: 'bool', name: 'sendChainGas', type: 'bool' }, - ], - name: 'BridgeRequested', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'oldChainGasAmount', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newChainGasAmount', type: 'uint256' }, - ], - name: 'ChainGasAmountUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'oldFeeRate', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newFeeRate', type: 'uint256' }, - ], - name: 'FeeRateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'address', name: 'token', type: 'address' }, - { indexed: false, internalType: 'address', name: 'recipient', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'FeesSwept', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { indexed: true, internalType: 'bytes32', name: 'previousAdminRole', type: 'bytes32' }, - { indexed: true, internalType: 'bytes32', name: 'newAdminRole', type: 'bytes32' }, - ], - name: 'RoleAdminChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'account', type: 'address' }, - { indexed: true, internalType: 'address', name: 'sender', type: 'address' }, - ], - name: 'RoleGranted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { indexed: true, internalType: 'address', name: 'account', type: 'address' }, - { indexed: true, internalType: 'address', name: 'sender', type: 'address' }, - ], - name: 'RoleRevoked', - type: 'event', - }, - { - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DISPUTE_PERIOD', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'FEE_BPS', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'FEE_RATE_MAX', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GOVERNOR_ROLE', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GUARD_ROLE', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MIN_DEADLINE_PERIOD', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'REFUNDER_ROLE', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'REFUND_DELAY', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'RELAYER_ROLE', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'uint32', name: 'dstChainId', type: 'uint32' }, - { internalType: 'address', name: 'sender', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'address', name: 'originToken', type: 'address' }, - { internalType: 'address', name: 'destToken', type: 'address' }, - { internalType: 'uint256', name: 'originAmount', type: 'uint256' }, - { internalType: 'uint256', name: 'destAmount', type: 'uint256' }, - { internalType: 'bool', name: 'sendChainGas', type: 'bool' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' }, - ], - internalType: 'struct IFastBridge.BridgeParams', - name: 'params', - type: 'tuple', - }, - ], - name: 'bridge', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - name: 'bridgeProofs', - outputs: [ - { internalType: 'uint96', name: 'timestamp', type: 'uint96' }, - { internalType: 'address', name: 'relayer', type: 'address' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - name: 'bridgeRelays', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - name: 'bridgeStatuses', - outputs: [ - { internalType: 'enum FastBridge.BridgeStatus', name: '', type: 'uint8' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - { internalType: 'address', name: 'relayer', type: 'address' }, - ], - name: 'canClaim', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'chainGasAmount', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes', name: 'request', type: 'bytes' }, - { internalType: 'address', name: 'to', type: 'address' }, - ], - name: 'claim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'deployBlock', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, - ], - name: 'dispute', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes', name: 'request', type: 'bytes' }, - ], - name: 'getBridgeTransaction', - outputs: [ - { - components: [ - { internalType: 'uint32', name: 'originChainId', type: 'uint32' }, - { internalType: 'uint32', name: 'destChainId', type: 'uint32' }, - { internalType: 'address', name: 'originSender', type: 'address' }, - { internalType: 'address', name: 'destRecipient', type: 'address' }, - { internalType: 'address', name: 'originToken', type: 'address' }, - { internalType: 'address', name: 'destToken', type: 'address' }, - { internalType: 'uint256', name: 'originAmount', type: 'uint256' }, - { internalType: 'uint256', name: 'destAmount', type: 'uint256' }, - { internalType: 'uint256', name: 'originFeeAmount', type: 'uint256' }, - { internalType: 'bool', name: 'sendChainGas', type: 'bool' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' }, - { internalType: 'uint256', name: 'nonce', type: 'uint256' }, - ], - internalType: 'struct IFastBridge.BridgeTransaction', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - ], - name: 'getRoleAdmin', - outputs: [ - { internalType: 'bytes32', name: '', type: 'bytes32' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { internalType: 'uint256', name: 'index', type: 'uint256' }, - ], - name: 'getRoleMember', - outputs: [ - { internalType: 'address', name: '', type: 'address' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - ], - name: 'getRoleMemberCount', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { internalType: 'address', name: 'account', type: 'address' }, - ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { internalType: 'address', name: 'account', type: 'address' }, - ], - name: 'hasRole', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'nonce', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'protocolFeeRate', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: '', type: 'address' }, - ], - name: 'protocolFees', - outputs: [ - { internalType: 'uint256', name: '', type: 'uint256' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes', name: 'request', type: 'bytes' }, - { internalType: 'bytes32', name: 'destTxHash', type: 'bytes32' }, - ], - name: 'prove', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes', name: 'request', type: 'bytes' }, - ], - name: 'refund', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes', name: 'request', type: 'bytes' }, - ], - name: 'relay', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { internalType: 'address', name: 'callerConfirmation', type: 'address' }, - ], - name: 'renounceRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes32', name: 'role', type: 'bytes32' }, - { internalType: 'address', name: 'account', type: 'address' }, - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'newChainGasAmount', type: 'uint256' }, - ], - name: 'setChainGasAmount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'newFeeRate', type: 'uint256' }, - ], - name: 'setProtocolFeeRate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }, - ], - name: 'supportsInterface', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'recipient', type: 'address' }, - ], - name: 'sweepProtocolFees', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - ] as const \ No newline at end of file + { + inputs: [{ internalType: 'address', name: '_owner', type: 'address' }], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'AccessControlBadConfirmation', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'account', type: 'address' }, + { internalType: 'bytes32', name: 'neededRole', type: 'bytes32' }, + ], + name: 'AccessControlUnauthorizedAccount', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'target', type: 'address' }], + name: 'AddressEmptyCode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], + name: 'AddressInsufficientBalance', + type: 'error', + }, + { + inputs: [], + name: 'AmountIncorrect', + type: 'error', + }, + { + inputs: [], + name: 'ChainIncorrect', + type: 'error', + }, + { + inputs: [], + name: 'DeadlineExceeded', + type: 'error', + }, + { + inputs: [], + name: 'DeadlineNotExceeded', + type: 'error', + }, + { + inputs: [], + name: 'DeadlineTooShort', + type: 'error', + }, + { + inputs: [], + name: 'DisputePeriodNotPassed', + type: 'error', + }, + { + inputs: [], + name: 'DisputePeriodPassed', + type: 'error', + }, + { + inputs: [], + name: 'FailedInnerCall', + type: 'error', + }, + { + inputs: [], + name: 'MsgValueIncorrect', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'token', type: 'address' }], + name: 'SafeERC20FailedOperation', + type: 'error', + }, + { + inputs: [], + name: 'SenderIncorrect', + type: 'error', + }, + { + inputs: [], + name: 'StatusIncorrect', + type: 'error', + }, + { + inputs: [], + name: 'TokenNotContract', + type: 'error', + }, + { + inputs: [], + name: 'TransactionRelayed', + type: 'error', + }, + { + inputs: [], + name: 'ZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'relayer', + type: 'address', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'BridgeDepositClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'BridgeDepositRefunded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'relayer', + type: 'address', + }, + ], + name: 'BridgeProofDisputed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'relayer', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'transactionHash', + type: 'bytes32', + }, + ], + name: 'BridgeProofProvided', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'relayer', + type: 'address', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'uint32', + name: 'originChainId', + type: 'uint32', + }, + { + indexed: false, + internalType: 'address', + name: 'originToken', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'destToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'originAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'destAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'chainGasAmount', + type: 'uint256', + }, + ], + name: 'BridgeRelayed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'transactionId', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { indexed: false, internalType: 'bytes', name: 'request', type: 'bytes' }, + { + indexed: false, + internalType: 'uint32', + name: 'destChainId', + type: 'uint32', + }, + { + indexed: false, + internalType: 'address', + name: 'originToken', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'destToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'originAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'destAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'sendChainGas', + type: 'bool', + }, + ], + name: 'BridgeRequested', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'oldChainGasAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newChainGasAmount', + type: 'uint256', + }, + ], + name: 'ChainGasAmountUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'oldFeeRate', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newFeeRate', + type: 'uint256', + }, + ], + name: 'FeeRateUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'FeesSwept', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DISPUTE_PERIOD', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'FEE_BPS', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'FEE_RATE_MAX', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'GOVERNOR_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'GUARD_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MIN_DEADLINE_PERIOD', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REFUNDER_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REFUND_DELAY', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'RELAYER_ROLE', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'uint32', name: 'dstChainId', type: 'uint32' }, + { internalType: 'address', name: 'sender', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'address', name: 'originToken', type: 'address' }, + { internalType: 'address', name: 'destToken', type: 'address' }, + { internalType: 'uint256', name: 'originAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'destAmount', type: 'uint256' }, + { internalType: 'bool', name: 'sendChainGas', type: 'bool' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + ], + internalType: 'struct IFastBridge.BridgeParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'bridge', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + name: 'bridgeProofs', + outputs: [ + { internalType: 'uint96', name: 'timestamp', type: 'uint96' }, + { internalType: 'address', name: 'relayer', type: 'address' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + name: 'bridgeRelays', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + name: 'bridgeStatuses', + outputs: [ + { internalType: 'enum FastBridge.BridgeStatus', name: '', type: 'uint8' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, + { internalType: 'address', name: 'relayer', type: 'address' }, + ], + name: 'canClaim', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'chainGasAmount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes', name: 'request', type: 'bytes' }, + { internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'claim', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'deployBlock', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'transactionId', type: 'bytes32' }, + ], + name: 'dispute', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'request', type: 'bytes' }], + name: 'getBridgeTransaction', + outputs: [ + { + components: [ + { internalType: 'uint32', name: 'originChainId', type: 'uint32' }, + { internalType: 'uint32', name: 'destChainId', type: 'uint32' }, + { internalType: 'address', name: 'originSender', type: 'address' }, + { internalType: 'address', name: 'destRecipient', type: 'address' }, + { internalType: 'address', name: 'originToken', type: 'address' }, + { internalType: 'address', name: 'destToken', type: 'address' }, + { internalType: 'uint256', name: 'originAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'destAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'originFeeAmount', type: 'uint256' }, + { internalType: 'bool', name: 'sendChainGas', type: 'bool' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + ], + internalType: 'struct IFastBridge.BridgeTransaction', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: 'role', type: 'bytes32' }], + name: 'getRoleAdmin', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'uint256', name: 'index', type: 'uint256' }, + ], + name: 'getRoleMember', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes32', name: 'role', type: 'bytes32' }], + name: 'getRoleMemberCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'hasRole', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nonce', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'protocolFeeRate', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'protocolFees', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes', name: 'request', type: 'bytes' }, + { internalType: 'bytes32', name: 'destTxHash', type: 'bytes32' }, + ], + name: 'prove', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'request', type: 'bytes' }], + name: 'refund', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'request', type: 'bytes' }], + name: 'relay', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'callerConfirmation', type: 'address' }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'role', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'newChainGasAmount', type: 'uint256' }, + ], + name: 'setChainGasAmount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'newFeeRate', type: 'uint256' }], + name: 'setProtocolFeeRate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }], + name: 'supportsInterface', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'token', type: 'address' }, + { internalType: 'address', name: 'recipient', type: 'address' }, + ], + name: 'sweepProtocolFees', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const diff --git a/packages/rfq-indexer/indexer/ponder.config.ts b/packages/rfq-indexer/indexer/ponder.config.ts index df73b39d5e..2329d0e89f 100644 --- a/packages/rfq-indexer/indexer/ponder.config.ts +++ b/packages/rfq-indexer/indexer/ponder.config.ts @@ -13,6 +13,7 @@ const blastChainId = 81457 const scrollChainId = 534352 const lineaChainId = 59144 const bnbChainId = 56 +const worldchainChainId = 480 const configByChainId = { [1]: { @@ -69,6 +70,12 @@ const configByChainId = { FastBridgeV2Address: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', FastBridgeV2StartBlock: 40497843, // first block and new block }, + [480]: { + transport: http(process.env.WORLDCHAIN_MAINNET_RPC), + chainName: 'worldchain', + FastBridgeV2Address: '0x05C62156C7C47E76223A560210EA648De5e6B53B', + FastBridgeV2StartBlock: 4598830, // first block and new block + }, disableCache: true, } @@ -137,6 +144,14 @@ export const networkDetails = { startBlock: configByChainId[bnbChainId].FastBridgeV2StartBlock, }, }, + [worldchainChainId]: { + name: configByChainId[worldchainChainId].chainName, + FastBridgeV2: { + address: configByChainId[worldchainChainId].FastBridgeV2Address, + abi: FastBridgeV2Abi, + startBlock: configByChainId[worldchainChainId].FastBridgeV2StartBlock, + }, + }, } as Record const config = createConfig({ @@ -181,6 +196,11 @@ const config = createConfig({ transport: configByChainId[bnbChainId].transport, // disableCache: configByChainId.disableCache, }, + [configByChainId[worldchainChainId].chainName]: { + chainId: worldchainChainId, + transport: configByChainId[worldchainChainId].transport, + // disableCache: configByChainId.disableCache, + }, }, contracts: { FastBridgeV2: { @@ -217,6 +237,11 @@ const config = createConfig({ address: networkDetails[bnbChainId]?.FastBridgeV2.address, startBlock: networkDetails[bnbChainId]?.FastBridgeV2.startBlock, }, + [configByChainId[worldchainChainId].chainName]: { + address: networkDetails[worldchainChainId]?.FastBridgeV2.address, + startBlock: + networkDetails[worldchainChainId]?.FastBridgeV2.startBlock, + }, }, abi: FastBridgeV2Abi, }, diff --git a/packages/rfq-indexer/indexer/ponder.schema.ts b/packages/rfq-indexer/indexer/ponder.schema.ts index 8d32ea595c..24f80bdf00 100644 --- a/packages/rfq-indexer/indexer/ponder.schema.ts +++ b/packages/rfq-indexer/indexer/ponder.schema.ts @@ -5,6 +5,7 @@ export default createSchema((p) => ({ id: p.string(), transactionId: p.string(), sender: p.string(), + request: p.string(), originToken: p.string(), destToken: p.string(), originAmount: p.bigint().optional(), diff --git a/packages/rfq-indexer/indexer/src/index.ts b/packages/rfq-indexer/indexer/src/index.ts index 3a6a71380f..2fe6711830 100644 --- a/packages/rfq-indexer/indexer/src/index.ts +++ b/packages/rfq-indexer/indexer/src/index.ts @@ -16,6 +16,7 @@ ponder.on('FastBridgeV2:BridgeRequested', async ({ event, context }) => { args: { transactionId, sender, + request, destChainId, originToken, destToken, @@ -33,6 +34,7 @@ ponder.on('FastBridgeV2:BridgeRequested', async ({ event, context }) => { data: { transactionId, sender: trim(sender), + request, originChainId: Number(chainId), originChain: getChainName(Number(chainId)), destChainId: Number(destChainId), diff --git a/packages/rfq-indexer/indexer/src/utils/chains.ts b/packages/rfq-indexer/indexer/src/utils/chains.ts index e521f65def..121f48c546 100644 --- a/packages/rfq-indexer/indexer/src/utils/chains.ts +++ b/packages/rfq-indexer/indexer/src/utils/chains.ts @@ -7,6 +7,7 @@ export const chainIdToName: { [key: number]: string } = { 534352: 'scroll', 59144: 'linea', 56: 'bnb', + 480: 'worldchain', } export const getChainName = (chainId: number): string => { diff --git a/packages/rfq-indexer/indexer/src/utils/formatAmount.ts b/packages/rfq-indexer/indexer/src/utils/formatAmount.ts index 9cbc1b2768..25db6cf46f 100644 --- a/packages/rfq-indexer/indexer/src/utils/formatAmount.ts +++ b/packages/rfq-indexer/indexer/src/utils/formatAmount.ts @@ -1,8 +1,17 @@ import { formatUnits } from 'viem' -const ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' +const ADDRESSES_WITH_18_DECIMALS = [ + '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // ETH + '0x2cFc85d8E48F8EAB294be644d9E25C3030863003', // WLD + '0x163f8c2467924be0ae7b5347228cabf260318753', // WLD + '0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1', // WLD +].map((address) => address.toLowerCase()) -export function formatAmount(amount: bigint, tokenAddress: string): string { - const decimals = tokenAddress.toLowerCase() === ETH_ADDRESS.toLowerCase() ? 18 : 6 +export const formatAmount = (amount: bigint, tokenAddress: string): string => { + const decimals = ADDRESSES_WITH_18_DECIMALS.includes( + tokenAddress.toLowerCase() + ) + ? 18 + : 6 return formatUnits(amount, decimals) -} \ No newline at end of file +} diff --git a/services/explorer/api/server_test.go b/services/explorer/api/server_test.go index 6a5a0b27df..1125854ecb 100644 --- a/services/explorer/api/server_test.go +++ b/services/explorer/api/server_test.go @@ -35,30 +35,31 @@ func TestHandleJSONDailyStat(t *testing.T) { // nolint valueStruct := gqlClient.GetDailyStatisticsByChain{ Response: []*struct { - Date *string "json:\"date\" graphql:\"date\"" - Ethereum *float64 "json:\"ethereum\" graphql:\"ethereum\"" - Optimism *float64 "json:\"optimism\" graphql:\"optimism\"" - Cronos *float64 "json:\"cronos\" graphql:\"cronos\"" - Bsc *float64 "json:\"bsc\" graphql:\"bsc\"" - Polygon *float64 "json:\"polygon\" graphql:\"polygon\"" - Fantom *float64 "json:\"fantom\" graphql:\"fantom\"" - Boba *float64 "json:\"boba\" graphql:\"boba\"" - Metis *float64 "json:\"metis\" graphql:\"metis\"" - Moonbeam *float64 "json:\"moonbeam\" graphql:\"moonbeam\"" - Moonriver *float64 "json:\"moonriver\" graphql:\"moonriver\"" - Klaytn *float64 "json:\"klaytn\" graphql:\"klaytn\"" - Arbitrum *float64 "json:\"arbitrum\" graphql:\"arbitrum\"" - Avalanche *float64 "json:\"avalanche\" graphql:\"avalanche\"" - Dfk *float64 "json:\"dfk\" graphql:\"dfk\"" - Aurora *float64 "json:\"aurora\" graphql:\"aurora\"" - Harmony *float64 "json:\"harmony\" graphql:\"harmony\"" - Canto *float64 "json:\"canto\" graphql:\"canto\"" - Dogechain *float64 "json:\"dogechain\" graphql:\"dogechain\"" - Base *float64 "json:\"base\" graphql:\"base\"" - Blast *float64 "json:\"blast\" graphql:\"blast\"" - Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" - Linea *float64 "json:\"linea\" graphql:\"linea\"" - Total *float64 "json:\"total\" graphql:\"total\"" + Date *string "json:\"date\" graphql:\"date\"" + Ethereum *float64 "json:\"ethereum\" graphql:\"ethereum\"" + Optimism *float64 "json:\"optimism\" graphql:\"optimism\"" + Cronos *float64 "json:\"cronos\" graphql:\"cronos\"" + Bsc *float64 "json:\"bsc\" graphql:\"bsc\"" + Polygon *float64 "json:\"polygon\" graphql:\"polygon\"" + Fantom *float64 "json:\"fantom\" graphql:\"fantom\"" + Boba *float64 "json:\"boba\" graphql:\"boba\"" + Metis *float64 "json:\"metis\" graphql:\"metis\"" + Moonbeam *float64 "json:\"moonbeam\" graphql:\"moonbeam\"" + Moonriver *float64 "json:\"moonriver\" graphql:\"moonriver\"" + Klaytn *float64 "json:\"klaytn\" graphql:\"klaytn\"" + Arbitrum *float64 "json:\"arbitrum\" graphql:\"arbitrum\"" + Avalanche *float64 "json:\"avalanche\" graphql:\"avalanche\"" + Dfk *float64 "json:\"dfk\" graphql:\"dfk\"" + Aurora *float64 "json:\"aurora\" graphql:\"aurora\"" + Harmony *float64 "json:\"harmony\" graphql:\"harmony\"" + Canto *float64 "json:\"canto\" graphql:\"canto\"" + Dogechain *float64 "json:\"dogechain\" graphql:\"dogechain\"" + Base *float64 "json:\"base\" graphql:\"base\"" + Blast *float64 "json:\"blast\" graphql:\"blast\"" + Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" + Linea *float64 "json:\"linea\" graphql:\"linea\"" + Worldchain *float64 "json:\"worldchain\" graphql:\"worldchain\"" + Total *float64 "json:\"total\" graphql:\"total\"" }{ { Total: &valueFloat, diff --git a/services/explorer/consumer/parser/rfqparser.go b/services/explorer/consumer/parser/rfqparser.go index 65da0f5bd7..8342b7efb1 100644 --- a/services/explorer/consumer/parser/rfqparser.go +++ b/services/explorer/consumer/parser/rfqparser.go @@ -120,6 +120,11 @@ func (p *RFQParser) MatureLogs(ctx context.Context, rfqEvent *model.RFQEvent, iF rfqEvent.TokenDecimal = new(uint8) *rfqEvent.TokenDecimal = 18 curCoinGeckoID = ethCoinGeckoID + } else if strings.EqualFold(tokenAddressStr, "0x2cFc85d8E48F8EAB294be644d9E25C3030863003") || strings.EqualFold(tokenAddressStr, "0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1") { + rfqEvent.TokenSymbol = "WLD" + rfqEvent.TokenDecimal = new(uint8) + *rfqEvent.TokenDecimal = 18 + curCoinGeckoID = "worldchain" } else { // Assuming any other token is USDC rfqEvent.TokenSymbol = "USDC" diff --git a/services/explorer/consumer/parser/tokendata/cache.go b/services/explorer/consumer/parser/tokendata/cache.go index ab52591c94..aaf76877e2 100644 --- a/services/explorer/consumer/parser/tokendata/cache.go +++ b/services/explorer/consumer/parser/tokendata/cache.go @@ -287,5 +287,10 @@ var tokenDataMap = map[string]TokenData{ "8453_0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb": {"DAI", 18, "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}, "1_0xAdF7C35560035944e805D98fF17d58CDe2449389": {"SPEC", 18, "0xAdF7C35560035944e805D98fF17d58CDe2449389"}, "8453_0x96419929d7949D6A801A6909c145C8EEf6A40431": {"SPEC", 18, "0x96419929d7949D6A801A6909c145C8EEf6A40431"}, - // Add additional tokens that are not part of the cache yet (and not by nature in bridge config) here + "480_0x2cFc85d8E48F8EAB294be644d9E25C3030863003": {"WLD", 18, "0x2cFc85d8E48F8EAB294be644d9E25C3030863003"}, + "10_0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1": {"WLD", 18, "0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1"}, + "480_0x79A02482A880bCE3F13e09Da970dC34db4CD24d1": {"USDC.e", 6, "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"}, + "480_0x4200000000000000000000000000000000000006": {"WETH", 18, "0x4200000000000000000000000000000000000006"}, + "1_0x163f8c2467924be0ae7b5347228cabf260318753": {"WLD", 18, "0x163f8c2467924be0ae7b5347228cabf260318753"}, + // Add additional tokens that are not part of the cache yet (and is not by nature in bridge config) here } diff --git a/services/explorer/graphql/client/client.go b/services/explorer/graphql/client/client.go index 04f5498f6d..704c82de6b 100644 --- a/services/explorer/graphql/client/client.go +++ b/services/explorer/graphql/client/client.go @@ -106,30 +106,31 @@ type GetAmountStatistic struct { } type GetDailyStatisticsByChain struct { Response []*struct { - Date *string "json:\"date\" graphql:\"date\"" - Ethereum *float64 "json:\"ethereum\" graphql:\"ethereum\"" - Optimism *float64 "json:\"optimism\" graphql:\"optimism\"" - Cronos *float64 "json:\"cronos\" graphql:\"cronos\"" - Bsc *float64 "json:\"bsc\" graphql:\"bsc\"" - Polygon *float64 "json:\"polygon\" graphql:\"polygon\"" - Fantom *float64 "json:\"fantom\" graphql:\"fantom\"" - Boba *float64 "json:\"boba\" graphql:\"boba\"" - Metis *float64 "json:\"metis\" graphql:\"metis\"" - Moonbeam *float64 "json:\"moonbeam\" graphql:\"moonbeam\"" - Moonriver *float64 "json:\"moonriver\" graphql:\"moonriver\"" - Klaytn *float64 "json:\"klaytn\" graphql:\"klaytn\"" - Arbitrum *float64 "json:\"arbitrum\" graphql:\"arbitrum\"" - Avalanche *float64 "json:\"avalanche\" graphql:\"avalanche\"" - Dfk *float64 "json:\"dfk\" graphql:\"dfk\"" - Aurora *float64 "json:\"aurora\" graphql:\"aurora\"" - Harmony *float64 "json:\"harmony\" graphql:\"harmony\"" - Canto *float64 "json:\"canto\" graphql:\"canto\"" - Dogechain *float64 "json:\"dogechain\" graphql:\"dogechain\"" - Base *float64 "json:\"base\" graphql:\"base\"" - Blast *float64 "json:\"blast\" graphql:\"blast\"" - Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" - Linea *float64 "json:\"linea\" graphql:\"linea\"" - Total *float64 "json:\"total\" graphql:\"total\"" + Date *string "json:\"date\" graphql:\"date\"" + Ethereum *float64 "json:\"ethereum\" graphql:\"ethereum\"" + Optimism *float64 "json:\"optimism\" graphql:\"optimism\"" + Cronos *float64 "json:\"cronos\" graphql:\"cronos\"" + Bsc *float64 "json:\"bsc\" graphql:\"bsc\"" + Polygon *float64 "json:\"polygon\" graphql:\"polygon\"" + Fantom *float64 "json:\"fantom\" graphql:\"fantom\"" + Boba *float64 "json:\"boba\" graphql:\"boba\"" + Metis *float64 "json:\"metis\" graphql:\"metis\"" + Moonbeam *float64 "json:\"moonbeam\" graphql:\"moonbeam\"" + Moonriver *float64 "json:\"moonriver\" graphql:\"moonriver\"" + Klaytn *float64 "json:\"klaytn\" graphql:\"klaytn\"" + Arbitrum *float64 "json:\"arbitrum\" graphql:\"arbitrum\"" + Avalanche *float64 "json:\"avalanche\" graphql:\"avalanche\"" + Dfk *float64 "json:\"dfk\" graphql:\"dfk\"" + Aurora *float64 "json:\"aurora\" graphql:\"aurora\"" + Harmony *float64 "json:\"harmony\" graphql:\"harmony\"" + Canto *float64 "json:\"canto\" graphql:\"canto\"" + Dogechain *float64 "json:\"dogechain\" graphql:\"dogechain\"" + Base *float64 "json:\"base\" graphql:\"base\"" + Blast *float64 "json:\"blast\" graphql:\"blast\"" + Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" + Linea *float64 "json:\"linea\" graphql:\"linea\"" + Worldchain *float64 "json:\"worldchain\" graphql:\"worldchain\"" + Total *float64 "json:\"total\" graphql:\"total\"" } "json:\"response\" graphql:\"response\"" } type GetMessageBusTransactions struct { @@ -502,6 +503,7 @@ const GetDailyStatisticsByChainDocument = `query GetDailyStatisticsByChain ($cha blast scroll linea + worldchain total } } diff --git a/services/explorer/graphql/client/queries/queries.graphql b/services/explorer/graphql/client/queries/queries.graphql index 60eb3d63eb..3d351f3cc1 100644 --- a/services/explorer/graphql/client/queries/queries.graphql +++ b/services/explorer/graphql/client/queries/queries.graphql @@ -155,6 +155,7 @@ query GetDailyStatisticsByChain($chainID: Int, $type: DailyStatisticType, $durat blast scroll linea + worldchain total } } diff --git a/services/explorer/graphql/server/graph/model/models_gen.go b/services/explorer/graphql/server/graph/model/models_gen.go index d3eeb60af4..c090c167e4 100644 --- a/services/explorer/graphql/server/graph/model/models_gen.go +++ b/services/explorer/graphql/server/graph/model/models_gen.go @@ -81,30 +81,31 @@ type DateResult struct { // DateResult is a given statistic for a given date. type DateResultByChain struct { - Date *string `json:"date,omitempty"` - Ethereum *float64 `json:"ethereum,omitempty"` - Optimism *float64 `json:"optimism,omitempty"` - Cronos *float64 `json:"cronos,omitempty"` - Bsc *float64 `json:"bsc,omitempty"` - Polygon *float64 `json:"polygon,omitempty"` - Fantom *float64 `json:"fantom,omitempty"` - Boba *float64 `json:"boba,omitempty"` - Metis *float64 `json:"metis,omitempty"` - Moonbeam *float64 `json:"moonbeam,omitempty"` - Moonriver *float64 `json:"moonriver,omitempty"` - Klaytn *float64 `json:"klaytn,omitempty"` - Arbitrum *float64 `json:"arbitrum,omitempty"` - Avalanche *float64 `json:"avalanche,omitempty"` - Dfk *float64 `json:"dfk,omitempty"` - Aurora *float64 `json:"aurora,omitempty"` - Harmony *float64 `json:"harmony,omitempty"` - Canto *float64 `json:"canto,omitempty"` - Dogechain *float64 `json:"dogechain,omitempty"` - Base *float64 `json:"base,omitempty"` - Blast *float64 `json:"blast,omitempty"` - Scroll *float64 `json:"scroll,omitempty"` - Linea *float64 `json:"linea,omitempty"` - Total *float64 `json:"total,omitempty"` + Date *string `json:"date,omitempty"` + Ethereum *float64 `json:"ethereum,omitempty"` + Optimism *float64 `json:"optimism,omitempty"` + Cronos *float64 `json:"cronos,omitempty"` + Bsc *float64 `json:"bsc,omitempty"` + Polygon *float64 `json:"polygon,omitempty"` + Fantom *float64 `json:"fantom,omitempty"` + Boba *float64 `json:"boba,omitempty"` + Metis *float64 `json:"metis,omitempty"` + Moonbeam *float64 `json:"moonbeam,omitempty"` + Moonriver *float64 `json:"moonriver,omitempty"` + Klaytn *float64 `json:"klaytn,omitempty"` + Arbitrum *float64 `json:"arbitrum,omitempty"` + Avalanche *float64 `json:"avalanche,omitempty"` + Dfk *float64 `json:"dfk,omitempty"` + Aurora *float64 `json:"aurora,omitempty"` + Harmony *float64 `json:"harmony,omitempty"` + Canto *float64 `json:"canto,omitempty"` + Dogechain *float64 `json:"dogechain,omitempty"` + Base *float64 `json:"base,omitempty"` + Blast *float64 `json:"blast,omitempty"` + Scroll *float64 `json:"scroll,omitempty"` + Linea *float64 `json:"linea,omitempty"` + Worldchain *float64 `json:"worldchain,omitempty"` + Total *float64 `json:"total,omitempty"` } type HeroType struct { diff --git a/services/explorer/graphql/server/graph/partials.go b/services/explorer/graphql/server/graph/partials.go index 85519e442b..da436a4096 100644 --- a/services/explorer/graphql/server/graph/partials.go +++ b/services/explorer/graphql/server/graph/partials.go @@ -401,6 +401,7 @@ const dailyVolumeBridgeMvPt1 = ` results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date)) AS date, @@ -445,6 +446,7 @@ const dailyVolumeBridge = ` results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date)) AS date, @@ -541,6 +543,7 @@ SELECT date, results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date), toString(m.date)) AS date, @@ -643,6 +646,7 @@ SELECT date, results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM ( SELECT date, @@ -674,6 +678,7 @@ SELECT date, results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM ( SELECT date, @@ -706,6 +711,7 @@ SELECT date, results[81457] AS blast, results[534352] AS scroll, results[59144] AS linea, + results[480] AS worldchain, arraySum(mapValues(results)) AS total FROM ( SELECT date, diff --git a/services/explorer/graphql/server/graph/resolver/server.go b/services/explorer/graphql/server/graph/resolver/server.go index 8abe58001c..29689da5c4 100644 --- a/services/explorer/graphql/server/graph/resolver/server.go +++ b/services/explorer/graphql/server/graph/resolver/server.go @@ -100,30 +100,31 @@ type ComplexityRoot struct { } DateResultByChain struct { - Arbitrum func(childComplexity int) int - Aurora func(childComplexity int) int - Avalanche func(childComplexity int) int - Base func(childComplexity int) int - Blast func(childComplexity int) int - Boba func(childComplexity int) int - Bsc func(childComplexity int) int - Canto func(childComplexity int) int - Cronos func(childComplexity int) int - Date func(childComplexity int) int - Dfk func(childComplexity int) int - Dogechain func(childComplexity int) int - Ethereum func(childComplexity int) int - Fantom func(childComplexity int) int - Harmony func(childComplexity int) int - Klaytn func(childComplexity int) int - Linea func(childComplexity int) int - Metis func(childComplexity int) int - Moonbeam func(childComplexity int) int - Moonriver func(childComplexity int) int - Optimism func(childComplexity int) int - Polygon func(childComplexity int) int - Scroll func(childComplexity int) int - Total func(childComplexity int) int + Arbitrum func(childComplexity int) int + Aurora func(childComplexity int) int + Avalanche func(childComplexity int) int + Base func(childComplexity int) int + Blast func(childComplexity int) int + Boba func(childComplexity int) int + Bsc func(childComplexity int) int + Canto func(childComplexity int) int + Cronos func(childComplexity int) int + Date func(childComplexity int) int + Dfk func(childComplexity int) int + Dogechain func(childComplexity int) int + Ethereum func(childComplexity int) int + Fantom func(childComplexity int) int + Harmony func(childComplexity int) int + Klaytn func(childComplexity int) int + Linea func(childComplexity int) int + Metis func(childComplexity int) int + Moonbeam func(childComplexity int) int + Moonriver func(childComplexity int) int + Optimism func(childComplexity int) int + Polygon func(childComplexity int) int + Scroll func(childComplexity int) int + Total func(childComplexity int) int + Worldchain func(childComplexity int) int } HeroType struct { @@ -660,6 +661,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DateResultByChain.Total(childComplexity), true + case "DateResultByChain.worldchain": + if e.complexity.DateResultByChain.Worldchain == nil { + break + } + + return e.complexity.DateResultByChain.Worldchain(childComplexity), true + case "HeroType.heroID": if e.complexity.HeroType.HeroID == nil { break @@ -1664,6 +1672,7 @@ type DateResultByChain { blast: Float scroll: Float linea: Float + worldchain: Float total: Float } @@ -4832,6 +4841,47 @@ func (ec *executionContext) fieldContext_DateResultByChain_linea(ctx context.Con return fc, nil } +func (ec *executionContext) _DateResultByChain_worldchain(ctx context.Context, field graphql.CollectedField, obj *model.DateResultByChain) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DateResultByChain_worldchain(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Worldchain, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*float64) + fc.Result = res + return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DateResultByChain_worldchain(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DateResultByChain", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _DateResultByChain_total(ctx context.Context, field graphql.CollectedField, obj *model.DateResultByChain) (ret graphql.Marshaler) { fc, err := ec.fieldContext_DateResultByChain_total(ctx, field) if err != nil { @@ -7190,6 +7240,8 @@ func (ec *executionContext) fieldContext_Query_dailyStatisticsByChain(ctx contex return ec.fieldContext_DateResultByChain_scroll(ctx, field) case "linea": return ec.fieldContext_DateResultByChain_linea(ctx, field) + case "worldchain": + return ec.fieldContext_DateResultByChain_worldchain(ctx, field) case "total": return ec.fieldContext_DateResultByChain_total(ctx, field) } @@ -10434,6 +10486,8 @@ func (ec *executionContext) _DateResultByChain(ctx context.Context, sel ast.Sele out.Values[i] = ec._DateResultByChain_scroll(ctx, field, obj) case "linea": out.Values[i] = ec._DateResultByChain_linea(ctx, field, obj) + case "worldchain": + out.Values[i] = ec._DateResultByChain_worldchain(ctx, field, obj) case "total": out.Values[i] = ec._DateResultByChain_total(ctx, field, obj) default: diff --git a/services/explorer/graphql/server/graph/schema/types.graphql b/services/explorer/graphql/server/graph/schema/types.graphql index 9b8bebdbd0..084c2da036 100644 --- a/services/explorer/graphql/server/graph/schema/types.graphql +++ b/services/explorer/graphql/server/graph/schema/types.graphql @@ -180,6 +180,7 @@ type DateResultByChain { blast: Float scroll: Float linea: Float + worldchain: Float total: Float } diff --git a/services/explorer/static/chainIDs.yaml b/services/explorer/static/chainIDs.yaml index 84add22b21..250c5db0a6 100644 --- a/services/explorer/static/chainIDs.yaml +++ b/services/explorer/static/chainIDs.yaml @@ -19,3 +19,4 @@ 81457: 'Blast' 534352: 'Scroll' 59144: 'Linea' +480: 'Worldchain' diff --git a/services/explorer/static/tokenIDToCoinGeckoID.yaml b/services/explorer/static/tokenIDToCoinGeckoID.yaml index 6c618da717..574cc7edc8 100644 --- a/services/explorer/static/tokenIDToCoinGeckoID.yaml +++ b/services/explorer/static/tokenIDToCoinGeckoID.yaml @@ -40,3 +40,4 @@ USDbC: 'usd-coin' crvUSD: 'usd-coin' USDB: 'usdb' SPEC: 'spectral' +WLD: 'worldcoin' diff --git a/services/explorer/static/tokenSymbolToCoinGeckoID.yaml b/services/explorer/static/tokenSymbolToCoinGeckoID.yaml index 231aa8ef74..6288259e8d 100644 --- a/services/explorer/static/tokenSymbolToCoinGeckoID.yaml +++ b/services/explorer/static/tokenSymbolToCoinGeckoID.yaml @@ -40,3 +40,4 @@ usdbc: 'usd-coin' crvusd: 'usd-coin' usdb: 'usdb' spec: 'spectral' +wld: 'worldcoin' diff --git a/services/explorer/static/tokenSymbolToTokenID.yaml b/services/explorer/static/tokenSymbolToTokenID.yaml index 83bac16402..eaf7f01c7d 100644 --- a/services/explorer/static/tokenSymbolToTokenID.yaml +++ b/services/explorer/static/tokenSymbolToTokenID.yaml @@ -42,3 +42,4 @@ usdbc: 'usd-coin' crvusd: 'usd-coin' usdb: 'usdb' spec: 'spectral' +wld: 'worldcoin'