Releases: lukepuplett/evoq-ethereum
Releases · lukepuplett/evoq-ethereum
v3.2.2: Fix duplicate key exception when decoding arrays of tuples
Fixed
- Fixed duplicate key exception when decoding arrays of tuples in
AbiDecoder.checkTypeAndSet()- Handles empty
SafeNamevalues (falls back toPosition.ToString()) - Handles duplicate keys by appending suffixes (
_1,_2, etc.) - Prevents
ArgumentException: An item with the same key has already been addedwhen decoding((address,uint256,bytes)[])and similar types
- Handles empty
Changes
src/Evoq.Ethereum/Ethereum.ABI/AbiDecoder.cs- Added defensive handling incheckTypeAndSetmethodsrc/Evoq.Ethereum/Evoq.Ethereum.csproj- Version bumped to 3.2.2
v3.2.1 - Fix Array of Tuples Decoding Bug
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.