diff --git a/contracts/zero-ex/CHANGELOG.json b/contracts/zero-ex/CHANGELOG.json index 7bf1666a9c..9289f1ecaa 100644 --- a/contracts/zero-ex/CHANGELOG.json +++ b/contracts/zero-ex/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.18.0", + "changes": [ + { + "note": "Use consistent returndatasize checks in UniswapFeature", + "pr": 96 + } + ] + }, { "version": "0.17.0", "changes": [ diff --git a/contracts/zero-ex/contracts/src/features/UniswapFeature.sol b/contracts/zero-ex/contracts/src/features/UniswapFeature.sol index a1c067d49f..65c17b721e 100644 --- a/contracts/zero-ex/contracts/src/features/UniswapFeature.sol +++ b/contracts/zero-ex/contracts/src/features/UniswapFeature.sol @@ -209,8 +209,8 @@ contract UniswapFeature is if iszero(staticcall(gas(), pair, 0xB00, 0x4, 0xC00, 0x40)) { bubbleRevert() } - // Revert if the pair contract does not return two words. - if iszero(eq(returndatasize(), 0x40)) { + // Revert if the pair contract does not return at least two words. + if lt(returndatasize(), 0x40) { revert(0,0) } @@ -389,8 +389,8 @@ contract UniswapFeature is // Call to allowance() failed. bubbleRevert() } - // Make sure the allowance call returned a single word. - if iszero(eq(returndatasize(), 0x20)) { + // Make sure the allowance call returned at least a word. + if lt(returndatasize(), 0x20) { revert(0, 0) } // Call succeeded.