Commit Graph

21 Commits

Author SHA1 Message Date
Matthias Seitz 1d40d4e049
fix(solc): make StorageLayout json parsing lossless (#1515) 2022-07-26 08:26:19 -07:00
Leo eb94e53d1f
Add basic solc model checker options (#1258)
* Add basic solc model checker options

* Changelog entry

* review 1

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-05-13 13:29:13 -07:00
Bjerg 0a031417d8
feat: remaining AST nodes (#1201)
* feat: remaining AST nodes

* docs: few rustdocs

* feat: add more node fields

* feat: add more ast nodes

* fix: actually deserialize node type

Note: This breaks `NodeType::Other` :/
2022-05-10 10:43:22 -07:00
Matthias Seitz c81254a8b6
test(solc): add another link with remapping test (#1191) 2022-04-28 07:07:08 -07:00
Matthias Seitz a978bc98af
fix(solc): remapping aware libraries (#1190)
* feat(solc): add Libraries type

* feat: add lib applied remappings

* test: add lib linking tests

* Update ethers-solc/src/artifacts/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* Update ethers-solc/src/artifacts/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* Update ethers-solc/src/artifacts/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* Update ethers-solc/src/artifacts/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* chore: rustfmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-04-28 05:18:24 -07:00
joshieDo a0f41c51af
fix(solc): when compiler-out metadata is empty and there's no `internalType` (#1182)
* add another compiler-out with fixes

* update changelog
2022-04-27 15:37:09 +03:00
AlexK e1d66b8cd3
feat(solc): yul compilation (#994)
* added yul compilation

* fix doctest

* fixes

* changelog

* cleanup

* fmt

* test update

* lint

* ci fix

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-03-10 10:42:02 -08:00
Roman Krasiuk 1f822e47e6
fix(solc): flatten import loc (#946)
* protograva test-data

* revert import parsing change

* compare flatten results against full strings
2022-02-22 16:22:24 +02:00
Matthew Wiriyathananon-Smith d8e5e536cc
Artifact ids (#882)
* Added ArtifactId

* Added ArtifactId impl and updated into_artifacts to return id

* Formatting

* Fixed warning

* Added versioned slug method to ArtifactId

* Added Ord/Eq derives to ArtifactId

* Fixed broken tests and doc tests

* Added failing test for versioned link references

* chore: ignore linkrefs test - to be fixed in followup

* test(solc): remove artifact json

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-02-18 17:48:56 +02:00
Matthias Seitz b295d73c4a
refactor(solc): rewrite compiler passes and cache change detection (#802)
* chore: clippy

* refactor: rewrite compiler passes and cache

* feat: more work on compile pipeline

* feat: add cache constructor

* add artifact filtering

* fine tune api

* feat: prepare version integration

* docs: more docs

* feat: add cacheentry2

* replace cacheentry types

* integrate new api

* docs: more docs

* feat: implement new output handler

* feat: integrate cached files in new compile pipeline

* refactor: more cache refactor

* docs: more docs

* feat: add source name mapping

* feat: implement new parallel solc

* refactor: do a little cleanup

* refactor: even more cleanup

* even more cleanup

* chore: make it compile

* chore: make it compile with all features

* chore: clippy fix

* feat: integrate new compiler pipeline

* docs: more docs

* refactor: move stuff around

* refactor: start deprecating output type

* chore: make it compile again

* chore(deps): bump solc version 0.2.0

* feat: unify output types

* cargo fix

* refactor: add contracts wrapper

* chore: replace ProjectCompileOutput

* docs: add more docs

* feat: add offline mode

* feat: more artifact helpers

* chore: cleanup cache

* chore: streamline types

* fix: better artifacts mapping

* chore: some cleanup

* chore: change artifact

* chore: add configure solc fn

* feat: add artifact reading

* feat: implement retain and extend

* feat: add cache extending

* feat: write to disk

* chore: make clippy happy

* feat: implement path mapping

* chore: nits

* feat: introduce states

* feat: add compiler state machine

* chore: move cache types to cache mod

* chore: make clippy happy

* feat: add debug derives

* fix: use resolved import source unit names

* fix: failing tests

* test: test multiple libs properly

* chore: make clippy happy

* chore: update CHANGELOG

* fix: doc tests

* fix: set offline mode correctly

* chore: make it compile again

* Update ethers-solc/src/artifacts.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* feat: find remappings by default

* typos

* add eth_syncing RPC (#848)

* add eth_syncing RPC

* Changelo updated

* small comments

* Intermediate SyncingStatus

* fix(core): adjust Ganache for new cli output (#851)

* fix: review comments

* fix: cache relative path bug

* chore: add cache example

* chore: use absolute paths

* fix: remove overwritten files from cache

* fix: rustfmt

* chore: more helper functions

* chore: export AggregatedOutput

* feat: implement helper functions

* feat: even more helpers

* fix: failing doc tests

* refactor: remove source name map tracking

* fix: determine artifacts in ephemeral mode

* refactor: allowed paths should not fail

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: rakita <rakita@users.noreply.github.com>
Co-authored-by: wolflo <33909953+wolflo@users.noreply.github.com>
2022-02-04 18:20:24 +02:00
Roman Krasiuk f9b0360d90
fix(solc): flatten duplicates (#813)
* fix solc flatten duplicates

* upd changelog

* sample eof newlines

* fix test name

* linter
2022-01-19 18:11:37 +02:00
Matthias Seitz 88b342287a
feat(solc): add source map parser (#658)
* feat(solc): add source map parser

* merge branch master

* make some types private

* chore: make id an option

* fix: support negative field values

* check parsed element
2022-01-06 13:54:46 +02:00
Matthias Seitz 275f7179bf
feat(solc): add hardhat artifact support (#677)
* feat: add hardhat artifact support

* test: add hh test

* feat: add hh fallback artifact handler

* add format detection

* chore: update changelog

* chore: typos
2021-12-11 19:39:39 +02:00
korboismoe 41f8e295a0
fix: remove changed artifacts from the cache (#630)
Duplicate artifacts will be returned if there is a
changed artifact that was already present in the
cache
2021-11-28 14:33:24 +02:00
korboismoe d77068e26a
fix: pass partial artifact cache to project compiler output (#623)
* fix: pass partial artifact cache to project compiler output

If the cache contains some artifacts but not all, the
project compiler output now contains the cached artifacts
in addition to the newly compiled artifacts.

* chore: update changelog

* fix: remove missing cache files before getting changed files

* fix: propagate error if reading cached artifacts fails
2021-11-26 18:49:19 +02:00
Matthias Seitz 1da62d65d2
refactor!: make artifactoutput a trait (#579)
* feat: add artifacts trait

* add artifactsoutput trait

* deprecated old artifactoutput

* feat: better artifacts handling

* force update

* feat: update metadata artifacts

* feat: add default to types

* feat: make useliteralcontent optional

* feat: replace ProjectCompilerOutput with struct

* docs

* add output function

* feat: add Artifact trait for reading Abi/Bytes from an artifact

* feat(solc): replace () for empty artifacts with a conditional check

As discussed with @mattsse the abstraction here might not be super clean, so we should revisit this if we do not like it

* chore: fix doctest

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-11-16 01:29:06 +02:00
Georgios Konstantopoulos 8f9c47dbdb
feat: auto-detect solc remappings (#574)
* feat: add remappings detection

* feat: add remappings to compiler settings

* fix: check for error if no contract was compiled

* feat: configure remappings and provide them to compiler settings

* test: check remappings

* chore: clippy lints

* fix: tests (#578)

* Update ethers-solc/src/remappings.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2021-11-13 21:31:55 +02:00
Georgios Konstantopoulos bfdf70cbea
feat(solc): allow providing --allow-args (#553)
* feat(solc): allow providing additional arguments

* feat(solc): allow providing --allow-args

* feat: more allow paths integration (#565)

* feat: more allow paths integration

* Update ethers-solc/src/compile.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* chore: only enable macros if feature is enabled

* test: add tests for multiple libs

* chore: fix solc test

* chore: only pas --allow-paths if there are any paths needed

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2021-11-08 22:11:45 +02:00
Georgios Konstantopoulos 23fb877c16
feat(solc): Multiple Solc Version detection (#551)
* test: ensure that compilation succeeds

* feat: add helper for parsing version req from a source

* feat: detect the latest compatible solc version for a VersionReq

* default to always enabling svm/async

* test: add project with multiple contract versions

* fix: always serde-default solc gas estimates

* fix: normalize evm version in settings before compiling

* feat: auto-detect version and compile if svm+async are on

* chore: warnings

* test: add a lock to ensure that there are no file conflicts when downloading solc

* test: add tests for finding solc installations

* chore: add features to ethers-rs config

* chore: s/first/latest on finding solc version fn docs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2021-11-03 10:05:09 +02:00
Matthias Seitz 5c6ce6b0a1
feat: improved solc management (#539)
* feat: improved solc management

* test: add basic test

* rustfmt

* rustfmt

* feat: add support for lib paths

* test: add dapp testing data

* feat: support dapp style libs

* fix: doc test

* use SOLC_path by default

* docs: import readme

* feat: add diagnostics

* chore: cleanup

* docs: update compile docs

* style: use red for error msg

* style: simplifiy error format

* chore: add newline on successful compiler run log

* feat: allow ignoring error codes so that they do not get logged

* chore: use solc 0.6.6 to match CI Version

* fix: make constructor public in hardhat tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-30 20:59:44 +03:00
Matthias Seitz 241491a237
feat: add ethers-solc crate (#522)
* feat: initial draft dedicated solc crate

* feat: add sources helper

* feat: more utility functions

* chore: more ergonomics

* chore: more ergonomics

* rustfmt

* feat: add solc error

* feat: replace eyre with thiserror

* fix: use serde default

* fix: compliant semver

* docs: fix comments
2021-10-26 14:28:10 +03:00