Skip to content

Releases: lukepuplett/evoq-ethereum

v3.2.2: Fix duplicate key exception when decoding arrays of tuples

06 Nov 20:40

Choose a tag to compare

Fixed

  • Fixed duplicate key exception when decoding arrays of tuples in AbiDecoder.checkTypeAndSet()
    • Handles empty SafeName values (falls back to Position.ToString())
    • Handles duplicate keys by appending suffixes (_1, _2, etc.)
    • Prevents ArgumentException: An item with the same key has already been added when decoding ((address,uint256,bytes)[]) and similar types

Changes

  • src/Evoq.Ethereum/Ethereum.ABI/AbiDecoder.cs - Added defensive handling in checkTypeAndSet method
  • src/Evoq.Ethereum/Evoq.Ethereum.csproj - Version bumped to 3.2.2

v3.2.1 - Fix Array of Tuples Decoding Bug

06 Nov 20:06

Choose a tag to compare

Bug Fixes

  • Fixed AbiDecoder component reuse bug when decoding arrays of tuples
  • Each array element now correctly maintains its own decoded values
  • Fixes duplicate key exception when calling ToDictionary() on decoded arrays of tuples

Changes

  • Added CloneComponents() helper method to create independent component instances
  • Updated DecodeStaticArray() to clone components for each array element
  • Updated DecodeDynamicArray() to clone components for each array element
  • Added test coverage for arrays of tuples decoding

Technical Details

Previously, when decoding arrays of tuples like ((address,uint256,bytes)[]), the decoder reused the same AbiParam component objects for all array elements. This caused all elements to share the same values (overwritten by the last decoded element) and could lead to duplicate key exceptions when accessing nested components.

The fix ensures each array element gets its own cloned component objects, maintaining correct decoded values for each element.