Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Security Review Limit Order Contracts #303

Closed
wants to merge 5 commits into from
Closed

Conversation

AntonioJuliano
Copy link
Member

No description provided.

@@ -648,6 +652,7 @@ contract LimitOrders is
returns (bytes memory)
{
Require.that(
// Why not exactly NUM_ORDER_BYTES + NUM_SIGNATURE_BYTES?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do this, but abi.decode uses the same logic (it doesn't care if the bytes array is too long). Thoughts?

@@ -575,6 +577,7 @@ contract LimitOrders is
returns (OrderInfo memory)
{
Require.that(
// Should validate it is either exactly NUM_ORDER_BYTES or NUM_ORDER_BYTES + NUM_SIGNATURE_BYTES

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do this, but abi.decode uses the same logic (it doesn't care if the bytes array is too long). Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm it seems like in general we should be as specific as possible

@@ -40,7 +40,9 @@ contract ICallee {
* @param data Arbitrary data given by the sender
*/
function callFunction(
address sender,
address sender, // This is set to msg.sender, so this would be the auth proxy for everything...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah nothing uses it (yet?) but it's already baked-in to the interface

@@ -461,6 +461,7 @@ contract LimitOrders is

// verify taker
Require.that(
// Line over max-len, does linter not catch this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess not, will fix

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigated and it seems that solium has a bug where it doesn't identify max-len in some cases (if the long line is not the first line of a statement)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -564,6 +565,7 @@ contract LimitOrders is
return totalMakerFilledAmount;
}

// Nit: order these helper functions in the order they are used

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

@@ -210,6 +210,7 @@ contract LimitOrders is
/**
* The owner can shut down the exchange.
*/
// Need to set these shut downs as immediate functions on multisig

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AntonioJuliano AntonioJuliano deleted the antonio-review branch August 27, 2019 23:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants