From c234125904ea2f05d6eeeca31c4f9af1c266e3bc Mon Sep 17 00:00:00 2001 From: Julian <52217955+julianmerlo95@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:30:06 -0300 Subject: [PATCH] [Blockchain Watcher] (KLAYTN) Map klaytn redeem events (#1508) Map klaytn redeem events Co-authored-by: julian merlo --- blockchain-watcher/config/mainnet.json | 5 +- .../mappers/contractsMapperConfig.json | 30 +++++++++ .../workers/target-events-3.yaml | 66 +++++++++++++++++++ 3 files changed, 97 insertions(+), 4 deletions(-) diff --git a/blockchain-watcher/config/mainnet.json b/blockchain-watcher/config/mainnet.json index 03398219..ee014f4a 100644 --- a/blockchain-watcher/config/mainnet.json +++ b/blockchain-watcher/config/mainnet.json @@ -79,10 +79,7 @@ "klaytn": { "network": "mainnet", "chainId": 13, - "rpcs": [ - "https://klaytn-mainnet-rpc.allthatnode.com:8551", - "https://public-en-cypress.klaytn.net" - ] + "rpcs": ["https://public-en-cypress.klaytn.net"] }, "celo": { "network": "mainnet", diff --git a/blockchain-watcher/src/infrastructure/mappers/contractsMapperConfig.json b/blockchain-watcher/src/infrastructure/mappers/contractsMapperConfig.json index 73cf9386..45929010 100644 --- a/blockchain-watcher/src/infrastructure/mappers/contractsMapperConfig.json +++ b/blockchain-watcher/src/infrastructure/mappers/contractsMapperConfig.json @@ -1793,6 +1793,36 @@ ] } ] + }, + { + "chain": "klaytn", + "protocols": [ + { + "addresses": [ + "0x5b08ac39eaed75c0439fc750d9fe7e1f9dd0193f", + "0xC7A13BE098720840dEa132D860fDfa030884b09A" + ], + "type": "Token Bridge", + "methods": [ + { + "methodId": "0xc6878519", + "method": "MethodCompleteTransfer" + }, + { + "methodId": "0xff200cde", + "method": "MethodCompleteAndUnwrapETH" + }, + { + "methodId": "0xe8059810", + "method": "MethodCreateWrapped" + }, + { + "methodId": "0xf768441f", + "method": "MethodUpdateWrapped" + } + ] + } + ] } ] } diff --git a/deploy/blockchain-watcher/workers/target-events-3.yaml b/deploy/blockchain-watcher/workers/target-events-3.yaml index 8709b6de..47473b7a 100644 --- a/deploy/blockchain-watcher/workers/target-events-3.yaml +++ b/deploy/blockchain-watcher/workers/target-events-3.yaml @@ -197,6 +197,39 @@ data: } } ] + }, + { + "id": "poll-redeemed-transactions-klaytn", + "chain": "klaytn", + "source": { + "action": "PollEvm", + "records": "GetEvmTransactions", + "config": { + "blockBatchSize": 100, + "commitment": "latest", + "interval": 15000, + "filters": [ + { + "addresses": [], + "type": "Portal Token Bridge (Connect, Portico, Omniswap, tBTC, etc)", + "topics": ["0xcaf280c8cfeba144da67230d9b009c8f868a75bac9a528fa0474be1ba317c169"], + "strategy": "GetTransactionsByLogFiltersStrategy" + } + ], + "chain": "klaytn", + "chainId": 13 + } + }, + "handlers": [ + { + "action": "HandleEvmTransactions", + "target": "sns", + "mapper": "evmRedeemedTransactionFoundMapper", + "config": { + "metricName": "process_vaa_event" + } + } + ] } ] mainnet-jobs.json: |- @@ -395,6 +428,39 @@ data: } } ] + }, + { + "id": "poll-redeemed-transactions-klaytn", + "chain": "klaytn", + "source": { + "action": "PollEvm", + "records": "GetEvmTransactions", + "config": { + "blockBatchSize": 100, + "commitment": "latest", + "interval": 15000, + "filters": [ + { + "addresses": [], + "type": "Portal Token Bridge (Connect, Portico, Omniswap, tBTC, etc)", + "topics": ["0xcaf280c8cfeba144da67230d9b009c8f868a75bac9a528fa0474be1ba317c169"], + "strategy": "GetTransactionsByLogFiltersStrategy" + } + ], + "chain": "klaytn", + "chainId": 13 + } + }, + "handlers": [ + { + "action": "HandleEvmTransactions", + "target": "sns", + "mapper": "evmRedeemedTransactionFoundMapper", + "config": { + "metricName": "process_vaa_event" + } + } + ] } ] ---