-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require txOrigin for RFQ orders, allow origins to register alternate … #47
Conversation
Question: what (if any) events do we need to add for registering and unregistering allowed origins? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, makes sense.
@@ -862,8 +880,11 @@ contract NativeOrdersFeature is | |||
).rrevert(); | |||
} | |||
|
|||
LibNativeOrdersStorage.Storage storage stor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we block scope this to free up the stack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed this.
@@ -86,10 +86,10 @@ blockchainTests.resets('NativeOrdersFeature', env => { | |||
await makerToken.mint(maker, order.makerAmount).awaitTransactionSuccessAsync(); | |||
if ('takerTokenFeeAmount' in order) { | |||
await takerToken | |||
.mint(taker, order.takerAmount.plus(order.takerTokenFeeAmount)) | |||
.mint(_taker, order.takerAmount.plus(order.takerTokenFeeAmount)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😇
/// @param origin The address doing the registration. | ||
/// @param addr The address being registered. | ||
/// @param allowed Indicates whether the address should be allowed. | ||
event OriginAllowed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make these names more verbose, like RfqOrderOriginAllowed
/// specifies the message sender as its txOrigin. | ||
/// @param origin The origin to update. | ||
/// @param allowed True to register, false to unregister. | ||
function registerAllowedOrigin(address origin, bool allowed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
function registerAllowedOrigin(address origin, bool allowed) | |
function registerAllowedRfqOrigin(address origin, bool allowed) |
831a2ae
to
737bd0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Let's merge (~‾▿‾)~
…addresses that can fill orders
Description
RFQ orders now require that the tx.origin is either txOrigin or another address that's been specifically allowed (via
registerAllowedOrigin()
).Testing instructions
yarn test
Types of changes
Checklist:
[WIP]
if necessary.