Skip to content
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

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Conversation

anna-carroll
Copy link
Contributor

per design doc

@anna-carroll anna-carroll self-assigned this Jun 29, 2024
src/Orders.sol Outdated Show resolved Hide resolved
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 {
Copy link
Contributor

@prestwich prestwich Jun 29, 2024

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?

Copy link
Contributor Author

@anna-carroll anna-carroll Jun 30, 2024

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...

Copy link
Contributor Author

@anna-carroll anna-carroll Jun 30, 2024

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

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

@anna-carroll anna-carroll left a 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.

Copy link
Contributor

@prestwich prestwich left a 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

src/Orders.sol Outdated Show resolved Hide resolved
src/Orders.sol Outdated Show resolved Hide resolved
src/Orders.sol Outdated Show resolved Hide resolved
@anna-carroll anna-carroll force-pushed the anna/order-interface branch from 96457ef to b94e158 Compare July 1, 2024 18:43
@anna-carroll anna-carroll merged commit 5e32da8 into main Jul 1, 2024
1 check passed
@anna-carroll anna-carroll deleted the anna/order-interface branch July 1, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants