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

Add Mevshare protocol #8

Merged
merged 6 commits into from
Jan 16, 2024
Merged

Add Mevshare protocol #8

merged 6 commits into from
Jan 16, 2024

Conversation

ferranbt
Copy link
Collaborator

@ferranbt ferranbt commented Jan 4, 2024

This PR adds a library for the Mev-Share protocol specified here

@dmarzzz
Copy link
Member

dmarzzz commented Jan 4, 2024

cc: @zeroXbrock

Copy link
Member

@zeroXbrock zeroXbrock left a comment

Choose a reason for hiding this comment

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

this is awesome, gonna save so much hassle. Just had one unresolved TODO @ferranbt not sure if you wanna merge before that's finished

request.headers = new string[](1);
request.headers[0] = "Content-Type:application/json";
request.body = encodeBundle(bundle);
// TODO: Add Flashbots signature
Copy link
Member

Choose a reason for hiding this comment

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

what's needed to add the FB signature? I think we can just add the private key as a param to this function, then it's basically copypasta from the ethers lib

bundle.inclusionBlock = 1;

bundle.bodies = new bytes[](1);
bundle.bodies[0] = abi.encode(1234);
Copy link
Member

Choose a reason for hiding this comment

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

just a nit but might change 1234 to 0x1234. I like to use hex values directly in cases like this where you'd want to see [where] the same number shows up in the test assertion

@ferranbt ferranbt requested a review from metachris as a code owner January 9, 2024 17:01
@ferranbt ferranbt merged commit f69be79 into main Jan 16, 2024
2 checks passed
@ferranbt ferranbt deleted the feature/mev-share-protocol branch March 2, 2024 15:31
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.

3 participants