From 3f6285822a2d5ef0974bea29bd33b41b6780ab2d Mon Sep 17 00:00:00 2001 From: Ruslan Serebriakov Date: Fri, 23 Jun 2023 12:50:06 +0100 Subject: [PATCH] fix code review comments --- src/Ethereum/ERC4337.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Ethereum/ERC4337.cpp b/src/Ethereum/ERC4337.cpp index da57fdc653f..6adad8f6739 100644 --- a/src/Ethereum/ERC4337.cpp +++ b/src/Ethereum/ERC4337.cpp @@ -31,21 +31,21 @@ Data getERC4337ExecuteBytecode(const Data& toAddress, const uint256_t& value, co // https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol#L65 Data getERC4337ExecuteBatchBytecode(const std::vector& toAddresses, const std::vector& amounts, const std::vector& payloads) { auto addressesParam = ABI::ParamArray(); - for (size_t i=0; i< toAddresses.size(); i++) { - addressesParam.addParam(std::make_shared(toAddresses[i])); + for (const auto& toAddress: toAddresses) { + addressesParam.addParam(std::make_shared(toAddress)); } auto valuesParam = ABI::ParamArray(); - for (size_t i=0; i< amounts.size(); i++) { - valuesParam.addParam(std::make_shared(amounts[i])); + for (const auto& amount: amounts) { + valuesParam.addParam(std::make_shared(amount)); } auto payloadsParam = ABI::ParamArray(); - for (size_t i=0; i< payloads.size(); i++) { - payloadsParam.addParam(std::make_shared(payloads[i])); + for (const auto& payload: payloads) { + payloadsParam.addParam(std::make_shared(payload)); } auto executeFunc = ABI::Function("executeBatch", ParamCollection{ - std::make_shared(addressesParam), - std::make_shared(valuesParam), - std::make_shared(payloadsParam)}); + std::make_shared(addressesParam), + std::make_shared(valuesParam), + std::make_shared(payloadsParam)}); Data executeFuncEncoded; executeFunc.encode(executeFuncEncoded); return executeFuncEncoded;