solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Add parser support for ``code`` data location.

Open ekpyron opened this issue 2 years ago • 1 comments

First step in https://github.com/ethereum/solidity/issues/13323.

Targetting the breaking branch, we should make code a proper keyword and allow its use as a data location.

A first step would then just disallowing any declaration in which code actually occurs as data location a syntax error (i.e. "not yet supported").

As a side-remark: once this is done, we could have a breaking release any time and implement the rest of the code data location non-breakingly.

ekpyron avatar Aug 09 '22 14:08 ekpyron

When closing this issue, https://github.com/ethereum/solidity/issues/13369 should be moved to the Design/Decide column of the Focus Board.

ekpyron avatar Aug 09 '22 15:08 ekpyron

Since we realized that address types have a .code member, this gets slightly more complicated.

In the call today, we decided to still keep both the address member and the data location called code for now. But that means that we need a parser hack during parsing member accesses:

In fact there is also such a parser hack in place for parsing the .address member.

In Parser::expectIdentifierTokenOrAddress, we just need to do the same for Token::Code as we do for Token::Address.

ekpyron avatar Sep 07 '22 14:09 ekpyron

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 300.0 1INCH (169.62 USD @ $0.57/1INCH) attached to it.

gitcoinbot avatar Oct 03 '22 14:10 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 264 years, 1 month from now. Please review their action plans below:

1) theosch has been approved to start work.

The plan is simple: 1) Learn where the data locations are parsed; 2) Make the code keyword be recognized and processed like it's requirefd (i.e. report a "not yet supported" error); that's all. As there is a lot of extra information in the discussion at GitHub, it's going to take a few hours only. Thanks

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Oct 03 '22 18:10 gitcoinbot

expectIdentifierTokenOrAddress

I believe there is probably significant work already done here: https://github.com/ethereum/solidity/pull/13468, including the hack mentioned by @ekpyron 🧐🤔 : https://github.com/ethereum/solidity/blob/add_parser_support_for_code_data_location/libsolidity/parsing/Parser.cpp#L2388

j05u3 avatar Oct 03 '22 22:10 j05u3

Yes, this issue is actively being worked on by the core compiler team - so it's not a particularly good choice for an external gitcoin grant...

ekpyron avatar Oct 04 '22 08:10 ekpyron

Didn't notice that I'm approved hours ago, the email notification was late; So can I try to make it? I think I can make it by tomorrow.

TheOsch avatar Oct 04 '22 10:10 TheOsch

As I was trying to say: there is nothing to take here - the change will be handled by the core team and is already in progress. The gitcoin grant here is not coming from the compiler team, so I can't approve or disapprove anything, but there is little point in working on this, resp. creating a new PR on it.

ekpyron avatar Oct 04 '22 12:10 ekpyron

@natalietop seems to have set up the bounty.

frangio avatar Oct 04 '22 19:10 frangio