evm.codes icon indicating copy to clipboard operation
evm.codes copied to clipboard

Feature request: support URL query strings for opcode searches

Open maurelian opened this issue 2 years ago • 6 comments

First, this site is amazing, thank you for continuing to improve it!

Request: I would love to be able automate a quick opcode (or precompile) search using a format like https://www.evm.codes/search?fork=arrow-glacier&opcode={query}. Where the fork defaults to the current live value.

I'd use this site on a daily basis if it were that easy. :)

maurelian avatar Mar 11 '22 13:03 maurelian

Yep, I see how this would be handy to quickly search without using the site, we are pretty heads down on our core product but we will keep this in mind, seems like a good starter project to onboard a frontend/full-stack while letting them read more about the EVM :)

If there is a front/end-full-stack engineer who sees it and wants to pick this up we will compensate them, in general, if you know someone who would want to help us improve this and work on some other opensource utilities free we have in mind on a part-time or even fulltime basis we would love to talk to them

dorlevi avatar Mar 11 '22 17:03 dorlevi

I would love to help with this feature.

@maurelian, do you want that endpoint to work kind of as an API? Like return data in JSON format. Also what date you would it to return? (opcode, name, gas, stack slots consumed, stack slots produced, description, ...)

Saw-mon-and-Natalie avatar Mar 14 '22 10:03 Saw-mon-and-Natalie

Thanks @Saw-mon-and-Natalie I guess the first step would be to add the fork in the link to opcodes, because I realise now that it is missing. That should not be too hard, if you want to start with that?

For example when I click on the first link to opcode 00, I get https://www.evm.codes/#00, would be even better with the fork.

peroket avatar Mar 14 '22 10:03 peroket

Should the link be like https://www.evm.codes/#00?fork=arrow-glacier even though the fork query is not being used?

Saw-mon-and-Natalie avatar Mar 14 '22 10:03 Saw-mon-and-Natalie

The idea would be to add also setting the fork according to the parameter (or leave the current behaviour if there is none).

peroket avatar Mar 14 '22 10:03 peroket

@peroket I didn't realize there was an anchor link for the numerical value of the opcode, that's nice.

@Saw-mon-and-Natalie No, I wasn't thinking of it like an API. More like a URL query, similar to what etherscan supports: https://etherscan.io/search?f=0&q=0x0000000000000000000000000000000000000000.

In this case, I'd envision this url https://www.evm.codes/opcodes?name=calldata, taking me to this view: image

Personal I'm less interested in setting the fork, I will usually just want to see the latest, but I included it in the initial request since it seems to be an important part of the schema the site is using.

maurelian avatar Mar 14 '22 14:03 maurelian

any progress on this feature ?

iFrostizz avatar Sep 17 '22 13:09 iFrostizz

we have not worked/prioritized it, but if someone submits a PR we will review and merge it.

dorlevi avatar Sep 17 '22 13:09 dorlevi

@maurelian I merged a PR that contains the changes described in your original post :) Closing this issue for now.

thevaizman avatar Sep 26 '22 16:09 thevaizman

Amazing, TY!

maurelian avatar Sep 28 '22 18:09 maurelian