@0x/contracts-zero-ex
: Use consistent returndatasize checks in UniswapFeature (#96)
Co-authored-by: Lawrence Forman <me@merklejerk.com>
This commit is contained in:
parent
f9078bb1c3
commit
2394eb62aa
@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "0.18.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Use consistent returndatasize checks in UniswapFeature",
|
||||||
|
"pr": 96
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "0.17.0",
|
"version": "0.17.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@ -209,8 +209,8 @@ contract UniswapFeature is
|
|||||||
if iszero(staticcall(gas(), pair, 0xB00, 0x4, 0xC00, 0x40)) {
|
if iszero(staticcall(gas(), pair, 0xB00, 0x4, 0xC00, 0x40)) {
|
||||||
bubbleRevert()
|
bubbleRevert()
|
||||||
}
|
}
|
||||||
// Revert if the pair contract does not return two words.
|
// Revert if the pair contract does not return at least two words.
|
||||||
if iszero(eq(returndatasize(), 0x40)) {
|
if lt(returndatasize(), 0x40) {
|
||||||
revert(0,0)
|
revert(0,0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +389,8 @@ contract UniswapFeature is
|
|||||||
// Call to allowance() failed.
|
// Call to allowance() failed.
|
||||||
bubbleRevert()
|
bubbleRevert()
|
||||||
}
|
}
|
||||||
// Make sure the allowance call returned a single word.
|
// Make sure the allowance call returned at least a word.
|
||||||
if iszero(eq(returndatasize(), 0x20)) {
|
if lt(returndatasize(), 0x20) {
|
||||||
revert(0, 0)
|
revert(0, 0)
|
||||||
}
|
}
|
||||||
// Call succeeded.
|
// Call succeeded.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user