From 0f3e650696088a61cd18879eff99de628853e437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 26 Feb 2026 12:19:26 -0800 Subject: [PATCH 1/2] use built-in String.encodeHex --- .../connectors/evm/UniswapV3SwapConnectors.cdc | 4 ++-- cadence/contracts/utils/EVMAbiHelpers.cdc | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc b/cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc index 4aa0d12c..2c2132d8 100644 --- a/cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc +++ b/cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc @@ -683,7 +683,7 @@ access(all) contract UniswapV3SwapConnectors { // optional dev guards let _chkIn = EVMAbiHelpers.abiUInt256(evmAmountIn) let _chkMin = EVMAbiHelpers.abiUInt256(minOutUint) - //panic("path: \(EVMAbiHelpers.toHex(pathBytes.value)), amountIn: \(evmAmountIn.toString()), amountOutMin: \(minOutUint.toString())") + //panic("path: \(String.encodeHex(pathBytes.value)), amountIn: \(evmAmountIn.toString()), amountOutMin: \(minOutUint.toString())") assert(_chkIn.length == 32, message: "amountIn not 32 bytes") assert(_chkMin.length == 32, message: "amountOutMin not 32 bytes") @@ -708,7 +708,7 @@ access(all) contract UniswapV3SwapConnectors { )! if swapRes.status != EVM.Status.successful { UniswapV3SwapConnectors._callError( - EVMAbiHelpers.toHex(calldata), + String.encodeHex(calldata), swapRes, self.routerAddress, idType, id, self.getType() ) } diff --git a/cadence/contracts/utils/EVMAbiHelpers.cdc b/cadence/contracts/utils/EVMAbiHelpers.cdc index 6bb426ed..ca7fb260 100644 --- a/cadence/contracts/utils/EVMAbiHelpers.cdc +++ b/cadence/contracts/utils/EVMAbiHelpers.cdc @@ -91,18 +91,6 @@ access(all) contract EVMAbiHelpers { return out } - access(all) fun toHex(_ bytes: [UInt8]): String { - let hex: [String] = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"] - var out = "" - var i = 0 - while i < bytes.length { - let b = bytes[i] - out = out.concat(hex[Int(b / 16)]).concat(hex[Int(b % 16)]) - i = i + 1 - } - return out - } - // Represents one ABI argument chunk access(all) struct ABIArg { access(all) let isDynamic: Bool From 341f97735617decb527710cdb24fe9ae5afeaf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 26 Feb 2026 12:19:36 -0800 Subject: [PATCH 2/2] remove unused uintArrayToString --- cadence/contracts/utils/EVMAbiHelpers.cdc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cadence/contracts/utils/EVMAbiHelpers.cdc b/cadence/contracts/utils/EVMAbiHelpers.cdc index ca7fb260..969d2ef4 100644 --- a/cadence/contracts/utils/EVMAbiHelpers.cdc +++ b/cadence/contracts/utils/EVMAbiHelpers.cdc @@ -78,19 +78,6 @@ access(all) contract EVMAbiHelpers { return self.abiDynamicBytes(utf8) } - access(all) fun uintArrayToString(_ arr: [UInt8]): String { - var out = "" - var i = 0 - while i < arr.length { - out = out.concat(arr[i].toString()) - if i < arr.length - 1 { - out = out.concat(",") - } - i = i + 1 - } - return out - } - // Represents one ABI argument chunk access(all) struct ABIArg { access(all) let isDynamic: Bool