-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Refactor Standard JSON Input/Output Documentation #16562
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
Draft
matheusaaguiar
wants to merge
4
commits into
fixRevertStringFlagInconsistentHandling
Choose a base branch
from
refactor-json-input-output-documentation
base: fixRevertStringFlagInconsistentHandling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/cmdlineTests/revert_strings_strip_legacy_require_custom_error/args
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --revert-strings strip --debug-info none --asm --optimize |
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/revert_strings_strip_legacy_require_custom_error/input.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| pragma solidity >=0.0; | ||
| // SPDX-License-Identifier: GPL-3.0 | ||
| contract C { | ||
| error MyError(uint errorCode, string errorMsg, bool flag); | ||
| function flag() pure public returns (bool) { return false; } | ||
| function f() pure external { | ||
| uint code = 8; | ||
| string memory eMsg = "error"; | ||
| require(false, MyError(code, eMsg, flag())); | ||
| } | ||
| } |
173 changes: 173 additions & 0 deletions
173
test/cmdlineTests/revert_strings_strip_legacy_require_custom_error/output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
|
|
||
| ======= input.sol:C ======= | ||
| EVM assembly: | ||
| mstore(0x40, 0x80) | ||
| callvalue | ||
| dup1 | ||
| iszero | ||
| tag_1 | ||
| jumpi | ||
| revert(0x00, 0x00) | ||
| tag_1: | ||
| pop | ||
| dataSize(sub_0) | ||
| dup1 | ||
| dataOffset(sub_0) | ||
| 0x00 | ||
| codecopy | ||
| 0x00 | ||
| return | ||
| stop | ||
|
|
||
| sub_0: assembly { | ||
| mstore(0x40, 0x80) | ||
| callvalue | ||
| dup1 | ||
| iszero | ||
| tag_1 | ||
| jumpi | ||
| revert(0x00, 0x00) | ||
| tag_1: | ||
| pop | ||
| jumpi(tag_2, lt(calldatasize, 0x04)) | ||
| shr(0xe0, calldataload(0x00)) | ||
| dup1 | ||
| 0x26121ff0 | ||
| eq | ||
| tag_3 | ||
| jumpi | ||
| dup1 | ||
| 0x890eba68 | ||
| eq | ||
| tag_4 | ||
| jumpi | ||
| tag_2: | ||
| revert(0x00, 0x00) | ||
| tag_3: | ||
| tag_5 | ||
| tag_6 | ||
| jump // in | ||
| tag_5: | ||
| stop | ||
| tag_4: | ||
| 0x40 | ||
| dup1 | ||
| mload | ||
| 0x00 | ||
| dup2 | ||
| mstore | ||
| swap1 | ||
| mload | ||
| swap1 | ||
| dup2 | ||
| swap1 | ||
| sub | ||
| 0x20 | ||
| add | ||
| swap1 | ||
| return | ||
| tag_6: | ||
| 0x40 | ||
| dup1 | ||
| mload | ||
| dup1 | ||
| dup3 | ||
| add | ||
| swap1 | ||
| swap2 | ||
| mstore | ||
| 0x05 | ||
| dup2 | ||
| mstore | ||
| shl(0xd9, 0x32b93937b9) | ||
| 0x20 | ||
| dup3 | ||
| add | ||
| mstore | ||
| 0x08 | ||
| swap1 | ||
| dup2 | ||
| dup2 | ||
| 0x00 | ||
| mload(0x40) | ||
| shl(0xe5, 0x01676c8b) | ||
| dup2 | ||
| mstore | ||
| 0x04 | ||
| add | ||
| tag_14 | ||
| swap4 | ||
| swap3 | ||
| swap2 | ||
| swap1 | ||
| tag_15 | ||
| jump // in | ||
| tag_14: | ||
| mload(0x40) | ||
| dup1 | ||
| swap2 | ||
| sub | ||
| swap1 | ||
| revert | ||
| tag_15: | ||
| dup4 | ||
| dup2 | ||
| mstore | ||
| 0x60 | ||
| 0x20 | ||
| dup3 | ||
| add | ||
| mstore | ||
| 0x00 | ||
| dup4 | ||
| mload | ||
| dup1 | ||
| 0x60 | ||
| dup5 | ||
| add | ||
| mstore | ||
| dup1 | ||
| 0x20 | ||
| dup7 | ||
| add | ||
| 0x80 | ||
| dup6 | ||
| add | ||
| mcopy | ||
| 0x00 | ||
| 0x80 | ||
| dup3 | ||
| dup6 | ||
| add | ||
| add | ||
| mstore | ||
| 0x80 | ||
| 0x1f | ||
| not | ||
| 0x1f | ||
| dup4 | ||
| add | ||
| and | ||
| dup5 | ||
| add | ||
| add | ||
| swap2 | ||
| pop | ||
| pop | ||
| dup3 | ||
| iszero | ||
| iszero | ||
| 0x40 | ||
| dup4 | ||
| add | ||
| mstore | ||
| swap5 | ||
| swap4 | ||
| pop | ||
| pop | ||
| pop | ||
| pop | ||
| jump // out | ||
|
|
||
| auxdata: <AUXDATA REMOVED> | ||
| } |
1 change: 1 addition & 0 deletions
1
...Tests/revert_strings_strip_legacy_require_custom_error_constructor_param_side_effect/args
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --revert-strings strip --debug-info none --asm --optimize |
12 changes: 12 additions & 0 deletions
12
.../revert_strings_strip_legacy_require_custom_error_constructor_param_side_effect/input.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| pragma solidity >=0.0; | ||
| // SPDX-License-Identifier: GPL-3.0 | ||
| contract C { | ||
| error MyError(uint errorCode, string errorMsg); | ||
| uint public counter = 0; | ||
| function count() public returns (uint) { return ++counter; } | ||
| function f() external { | ||
| string memory eMsg = "error"; | ||
| require(false, MyError(count(), eMsg)); | ||
| counter += 2; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think it makes sense to add this but leave the comments in the JSON example as is. Doing this will generate more work for us because we'll have duplicate information.