From 1ef9490540f2c3e43cbb18929a3d5d42d46e2ec0 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 5 Jul 2024 12:48:11 +1000 Subject: [PATCH] Fix get contract deployed in latest block, request returns result object --- src/provider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/provider.cpp b/src/provider.cpp index 4410bf1..7c9284d 100644 --- a/src/provider.cpp +++ b/src/provider.cpp @@ -724,7 +724,7 @@ std::string Provider::getContractDeployedInLatestBlock() { throw std::runtime_error("Failed to get the latest block"); nlohmann::json blockJson = *result; - for (const auto& tx : blockJson["result"]["transactions"]) { + for (const auto& tx : blockJson["transactions"]) { std::optional transactionReceipt = getTransactionReceipt(tx["hash"].get()); if (transactionReceipt.has_value()) return transactionReceipt->at("contractAddress").get();