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(chisel): Introduces a Solidity REPL #3465

Merged
merged 125 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
e16f4c1
Init chisel
clabby Oct 7, 2022
78f2f3c
Merge branch 'master' into feat/repl
clabby Oct 7, 2022
f01a669
Playing w/ `TempProject` to start
clabby Oct 7, 2022
67d69a4
Temp changes to the readline, back to school work
clabby Oct 7, 2022
e7ea207
parse with solang_parser
refcell Oct 8, 2022
03474b2
readme updates, feature bog :sweat:
refcell Oct 8, 2022
953a845
chisel session loading
refcell Oct 8, 2022
cee35fd
Merge pull request #1 from whitenois3/@abigger87/solang_parser
clabby Oct 8, 2022
1fe513d
Start builtin command module
clabby Oct 8, 2022
b55227d
Merge pull request #2 from whitenois3/feat/builtins
clabby Oct 8, 2022
fc55768
Store raw source alongside parsed source units
clabby Oct 8, 2022
8a7ea0c
Merge branch 'feat/builtins' into feat/repl
clabby Oct 8, 2022
0550d41
fix versioning in environment using semver
refcell Oct 8, 2022
fe3862b
merge upstream :warning:
refcell Oct 8, 2022
db80ca6
Start REPL executor
clabby Oct 8, 2022
63eb7fd
Merge pull request #3 from whitenois3/@abigger87/env_enhancements
refcell Oct 8, 2022
87d50d9
serde serialize and deserialize
refcell Oct 8, 2022
e4112d2
upstream merge
refcell Oct 8, 2022
299ffb9
Clean; Scrap first runner impl
clabby Oct 8, 2022
3369bdb
Merge branch 'feat/repl' into clabby/repl/executor
clabby Oct 8, 2022
22b801e
Merge with `feat/repl`
clabby Oct 8, 2022
f07bc0b
Hack together beginnings of runner
clabby Oct 8, 2022
deecf67
caching progress
refcell Oct 10, 2022
fff94d9
optimistically use first pragma definition
refcell Oct 10, 2022
993f237
tests pass :construction:
refcell Oct 10, 2022
d885070
session cache io
refcell Oct 10, 2022
47ba73b
formatting :sparkles:
refcell Oct 10, 2022
bb955b4
fixes
refcell Oct 10, 2022
e3b2a60
cache tests and fixes
refcell Oct 10, 2022
607b103
Merge pull request #5 from whitenois3/@abigger87/cache
refcell Oct 10, 2022
4762dca
upstream sync
refcell Oct 10, 2022
29f843b
merge upstream :warning:
refcell Oct 10, 2022
2b233b5
add chisel to foundryup
refcell Oct 10, 2022
cc79fdc
Merge pull request #6 from whitenois3/@abigger87/foundryup_updates
refcell Oct 10, 2022
e73a2e2
runner port
refcell Oct 11, 2022
9be045d
initial soli source generation port
refcell Oct 11, 2022
cc29c1a
stashing refactor progress
refcell Oct 11, 2022
0aad10b
refactor nearly there
refcell Oct 11, 2022
5089fb5
Merge pull request #7 from whitenois3/@abigger87/constructed_source
refcell Oct 11, 2022
7eaccad
merge upstream
refcell Oct 11, 2022
eca445d
:sparkles: fix styling
refcell Oct 11, 2022
b28e007
Rip script runner into chisel
clabby Oct 12, 2022
b4366e4
Progress- still broken
clabby Oct 13, 2022
6883033
Progress
clabby Oct 15, 2022
0c1639a
Refactors; it's kinda alive :rocket:
clabby Oct 16, 2022
ecbf347
Merge pull request #8 from whitenois3/clabby/repl/mvp
clabby Oct 16, 2022
2ef28c0
:broom:
clabby Oct 16, 2022
a4653b8
start inspection formatter
clabby Oct 16, 2022
3f834d8
Fix caching
clabby Oct 16, 2022
263f591
Merge pull request #4 from whitenois3/clabby/repl/executor
clabby Oct 17, 2022
1dfad75
Merge branch 'master' into feat/repl
clabby Oct 17, 2022
e0707d9
Merge w/ upstream
clabby Oct 17, 2022
db271b7
Foundry / EVM configuration; on-the-fly forking
clabby Oct 18, 2022
13b7acb
Port `soli`'s `SolidityHelper`
clabby Oct 18, 2022
9470f1a
Merge branch 'master' into feat/repl
clabby Oct 18, 2022
cb23b1e
Update README tasks
clabby Oct 18, 2022
4dbc1d2
Start tracing support; :broom:
clabby Oct 20, 2022
7eda9c2
Fix dynamic bytes inspection formatting
clabby Oct 20, 2022
07e40ea
:broom:
clabby Oct 20, 2022
e61bf4b
Merge pull request #9 from whitenois3/@clabby/repl/traces
clabby Oct 20, 2022
e9e2ae2
Clear session ID on `!clearcache` command
clabby Oct 20, 2022
084f11b
Fix `int` inspection formatting
clabby Oct 20, 2022
9dd2159
Remove unnecessary fields from `ChiselResult`
clabby Oct 21, 2022
684d3bb
Inherit `Script.sol` from `testdata`
clabby Oct 22, 2022
1556c28
:broom:, error handling, & readme
clabby Oct 22, 2022
f7384bf
Merge pull request #10 from whitenois3/chisel/forge-std
clabby Oct 22, 2022
17f8dd0
Merge branch 'master' into feat/repl
clabby Oct 22, 2022
8cd68aa
solc version configuration, `memdump` / `stackdump` commands, and `rp…
clabby Oct 22, 2022
a55c772
Bug fixes, cache tests, README updates
clabby Oct 23, 2022
600686f
Include `forge-std` contracts in binary
clabby Oct 24, 2022
cd4d3ca
Add criterion benchmarks
clabby Oct 24, 2022
69cda3c
Add binary subcommands
clabby Oct 24, 2022
da1ba6b
Project remapping support
clabby Oct 24, 2022
ce7b476
Add `!export` command
clabby Oct 26, 2022
ac2f2ff
:broom:
clabby Oct 26, 2022
c9b2cf8
Checkout submodules in release workflow
clabby Oct 26, 2022
7e6dc0e
Merge branch 'master' into @clabby/chisel/review-prep
clabby Oct 26, 2022
a3080d2
Update README
clabby Oct 26, 2022
0a2eff0
Merge pull request #11 from whitenois3/@clabby/chisel/review-prep
clabby Oct 26, 2022
096b7aa
Add @mds1's suggestions
clabby Oct 27, 2022
39f172c
README tasks update
clabby Oct 27, 2022
c3aeb06
Fetch interface of verified contracts on Etherscan
clabby Oct 27, 2022
7bf4fe8
Optional script inheritance; Clean up help menu; :broom:
clabby Oct 28, 2022
01814ee
Command shortcuts; fork URL verification; :broom:
clabby Oct 28, 2022
be18834
expression evaluation WIP
clabby Oct 29, 2022
6b32b6c
Updates
clabby Oct 31, 2022
38496db
Merge pull request #12 from whitenois3/repl/expression-eval
clabby Oct 31, 2022
e23160d
Update README checklist
clabby Oct 31, 2022
938e516
Merge branch 'master' into feat/repl
clabby Nov 12, 2022
1f9d53c
Clean up script exporting
clabby Nov 12, 2022
78f3cb6
Use `forge-fmt` to format source for both `!export` and `!source`
clabby Nov 12, 2022
e366920
Move to laptop
clabby Nov 13, 2022
ff081b7
Update checklist
clabby Nov 17, 2022
061a5b7
Function call expression eval updates; Still not a fan
clabby Nov 18, 2022
55d1d6d
Merge branch 'feat/repl' into repl/updates
clabby Nov 18, 2022
1267808
:broom:
clabby Nov 18, 2022
79d4fde
Big improvements in func expression eval
clabby Nov 19, 2022
d03c8d5
More improvements; :broom: tmrw
clabby Nov 19, 2022
7024c44
Refactor intermediate output, expression eval stable
clabby Nov 19, 2022
840df92
Merge pull request #13 from whitenois3/repl/updates
clabby Nov 19, 2022
f2a9583
Merge branch 'master' into feat/repl
clabby Nov 19, 2022
e5af529
Resolve conflicts w/ `master`
clabby Nov 19, 2022
46ac42c
Update preview gif
clabby Nov 20, 2022
9503cc7
Fix external contract expression evaluation; Make CI happy
clabby Nov 23, 2022
930f16b
:broom:; fix parenthesis eval; add `!exec` command
clabby Nov 23, 2022
33c416c
README
clabby Nov 24, 2022
59da0cc
Merge branch 'master' into feat/repl
clabby Nov 24, 2022
e6ed1ee
Fix CI
clabby Nov 24, 2022
6ca012b
Bump `forge-std` to `v1.1.1`
clabby Nov 25, 2022
00d6ffd
Merge pull request #15 from whitenois3/fix/chisel/ci
clabby Nov 25, 2022
f33fe04
Bump chisel version; fix `foundryup` repo / commit fetch; use `vergen…
clabby Nov 25, 2022
a812f38
Print `stderr` in chisel's `!exec` command
clabby Nov 25, 2022
f565984
Clean up benches
clabby Nov 25, 2022
723fdd9
Finish README; chisel subcommand descriptions for manpage
clabby Nov 25, 2022
6aac079
small :broom:
clabby Nov 26, 2022
321bb3a
Merge branch 'master' into feat/repl
clabby Nov 29, 2022
927c291
Fix conflicts
clabby Nov 29, 2022
139ff3f
Start addressing Matt's nits
clabby Nov 29, 2022
caad14e
Merge branch 'master' into feat/repl
clabby Dec 2, 2022
73cf641
Resolve conflicts
clabby Dec 2, 2022
0047d51
Remove `forge-std` submodule in favor of testdata's `Cheats.sol`
clabby Dec 6, 2022
374e111
No need to check out submodules in workflows anymore
clabby Dec 6, 2022
63bc09b
Lint
clabby Dec 6, 2022
cd60940
Merge branch 'master' into feat/repl
clabby Dec 6, 2022
33777bb
Fix clippy 0.1.67 errors
clabby Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
# Check out `testdata/forge-std` submodule for chisel build.
with:
submodules: 'recursive'

- name: Install toolchain
uses: actions-rs/toolchain@v1
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -66,6 +68,8 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install nextest
uses: taiki-e/install-action@nextest
- run: mkdir -p ~/.cargo/bin
Expand Down Expand Up @@ -164,6 +168,8 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -182,6 +188,8 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -207,6 +215,9 @@ jobs:
args: --all --all-features -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}

- name: remove forge-std files
run: rm -rf testdata/lib/forge-std/**

- name: forge fmt
run: cargo run --bin forge -- fmt --check testdata/

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "testdata/lib/forge-std"]
path = testdata/lib/forge-std
url = https://github.com/foundry-rs/forge-std
Copy link
Member

Choose a reason for hiding this comment

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

this has since been removed

does chisel require forge-std in tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Chisel includes Vm.sol in the binary for use within the compilation source, so the inclusion of cheatcodes would have to be reworked if we decide to remove it. The idea here was to not have to fetch the source from GitHub so that chisel can be used in an offline setting.

See: https://github.com/whitenois3/foundry/blob/feat/repl/chisel/src/session_source.rs#L20

Copy link
Member

Choose a reason for hiding this comment

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

having the submodule there caused the tests to fail iirc.

can we replace this with the Cheats.sol file in testdata instead? perhaps rename to Vm?

The reason why we don't have forge-std as a module here is that we'd otherwise have a cyclical dependency forge <-> forge-std

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good- adjusted the session source to use Cheats.sol. We could rename it for continuity, but shouldn't be necessary. Kept the variable name as vm, so no ux changes apart from changing the import.

155 changes: 139 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ members = [
"forge",
"ui",
"utils",
"chisel",
Copy link
Collaborator

Choose a reason for hiding this comment

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

(arbitrary comment location to start a thread)

Is there a way to log the results of statements, for example in solidity shell I'll often test things like this
image

You can see solidity-shell shows the output of 1 << 4 but chisel does not

Copy link
Contributor

@clabby clabby Oct 28, 2022

Choose a reason for hiding this comment

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

Yeah, was planning on getting on expression evaluation over the weekend 😄 See: checklist.

Will require a small refactor of the current inspection logic, but shouldn't be too bad. At the moment, you have to assign values to a variable before inspecting them, which is pretty bad devx.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah sorry missed that in the checklist! Makes sense 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be in a fairly stable state now. Let me know if you run into any issues with it!

]

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion anvil/core/src/eth/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ impl PendingTransaction {
}

/// Represents all relevant information of an executed transaction
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct TransactionInfo {
pub transaction_hash: H256,
pub transaction_index: u32,
Expand Down
Loading