-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: revise Order event interface #49
Conversation
src/Orders.sol
Outdated
/// @param amount - The amount of the token to be transferred to the recipient. | ||
function fulfillSwap(uint256 originChainId, address token, address recipient, uint256 amount) external payable { | ||
function fill(address recipient, address token, uint256 amount) external payable { |
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.
why not make this a list of structs too?
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.
we explored doing this earlier, and at the time we decided it was cleaner code for Fillers to call this function multiple times - once per Output - rather than arrays of structs.
passing arrays when initiating the Order adds new functionality (enabling end users to tie more complex inputs/outputs to an Order than a one-for-one swap), but passing arrays here doesn't add new functionality.
all that said, it probably makes sense to align style between the two contracts now that we've shifted the initiate side...
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.
when writing this PR I considered doing an array of Outputs here to match style, but I didn't like that the Output struct contains the target chainId
, which is self-evident on the target chain itself; I figured that passing extraneous info as calldata && emitting it adds gas costs without benefits in visibility
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.
all that said, it probably makes sense to align style between the two contracts now that we've shifted the initiate side...
this is what i'm more concerned about. could easily have both single and list?
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.
explored this in a separate branch: #53
honestly think what's in this branch kinda makes more sense..
maybe at this point let's wrap up this PR and then decide on the other branch as a fast follow?
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.
@prestwich responded to all your comments - answers are all kind of finicky style things. tried to explain my reasoning clearly, but i'm open to discussion on any of them. lmk what you think.
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.
no necessary code changes
96457ef
to
b94e158
Compare
per design doc