Skip to content

Commit

Permalink
Merge branch 'main' into rakita/prague_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Jul 15, 2024
2 parents d9e7306 + 67a46cf commit b0f6fe6
Show file tree
Hide file tree
Showing 55 changed files with 1,113 additions and 1,237 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @danipopes @evalir
* @danipopes @klkvr @mattsse
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,38 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.0](https://github.com/foundry-rs/compilers/releases/tag/v0.8.0) - 2024-06-17
## [0.9.0](https://github.com/foundry-rs/compilers/releases/tag/v0.9.0) - 2024-06-29

### Bug Fixes

- Doctests ([#154](https://github.com/foundry-rs/compilers/issues/154))
- [flatten] Small bugs ([#153](https://github.com/foundry-rs/compilers/issues/153))

### Dependencies

- Cleanup workspace deps ([#158](https://github.com/foundry-rs/compilers/issues/158))

### Features

- Respect `paths.libraries` for Vyper ([#159](https://github.com/foundry-rs/compilers/issues/159))

### Miscellaneous Tasks

- Improve stripping file prefixes ([#164](https://github.com/foundry-rs/compilers/issues/164))
- Improve some trace-level logs ([#163](https://github.com/foundry-rs/compilers/issues/163))
- Remove most impl AsRef<str,Path> ([#157](https://github.com/foundry-rs/compilers/issues/157))
- Clarify version cache lock ([#160](https://github.com/foundry-rs/compilers/issues/160))
- Sort derives, derive Eq more ([#161](https://github.com/foundry-rs/compilers/issues/161))
- [meta] Update CODEOWNERS
- Release 0.8.0
- Rename foundry-compilers-project into foundry-compilers ([#152](https://github.com/foundry-rs/compilers/issues/152))
- Clippy
- Move lints to workspace ([#149](https://github.com/foundry-rs/compilers/issues/149))
- Remove unused files and workflow ([#148](https://github.com/foundry-rs/compilers/issues/148))

### Other

- Symlink readme
- Sync workflows

### Performance
Expand All @@ -28,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Refactor

- Unify sources and filtered sources ([#162](https://github.com/foundry-rs/compilers/issues/162))
- [flatten] Move compilation logic into `Flattener` ([#143](https://github.com/foundry-rs/compilers/issues/143))
- Extract artifacts to a separate crate ([#142](https://github.com/foundry-rs/compilers/issues/142))

Expand Down Expand Up @@ -603,4 +621,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Repo improvements ([#13](https://github.com/foundry-rs/compilers/issues/13))

<!-- generated by git-cliff -->
<!-- generated by git-cliff -->
42 changes: 24 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ resolver = "2"

[workspace.package]
authors = ["Foundry Maintainers"]
version = "0.8.0"
version = "0.9.0"
rust-version = "1.70"
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/compilers"
homepage = "https://github.com/foundry-rs/compilers"
documentation = "https://docs.rs/foundry-compilers"
description = "Utilities for working with solidity compilers, namely solc"
description = "Utilities for working with EVM language compilers"
keywords = ["foundry", "solidity", "solc", "ethereum", "ethers"]
edition = "2021"
exclude = [".github/", "scripts/", "test-data/"]
Expand All @@ -31,27 +31,33 @@ unused-must-use = "deny"
all = "warn"

[workspace.dependencies]
foundry-compilers-artifacts-solc = { path = "crates/artifacts/solc", version = "0.8.0" }
foundry-compilers-artifacts-vyper = { path = "crates/artifacts/vyper", version = "0.8.0" }
foundry-compilers-artifacts = { path = "crates/artifacts/artifacts", version = "0.8.0" }
foundry-compilers-core = { path = "crates/core", version = "0.8.0" }
serde = { version = "1", features = ["derive", "rc"] }
semver = { version = "1.0", features = ["serde"] }
serde_json = "1.0"
alloy-primitives = { version = "0.7", features = ["serde", "rand"] }
foundry-compilers = { path = "crates/compilers", version = "0.9.0" }
foundry-compilers-artifacts = { path = "crates/artifacts/artifacts", version = "0.9.0" }
foundry-compilers-artifacts-solc = { path = "crates/artifacts/solc", version = "0.9.0" }
foundry-compilers-artifacts-vyper = { path = "crates/artifacts/vyper", version = "0.9.0" }
foundry-compilers-core = { path = "crates/core", version = "0.9.0" }

alloy-json-abi = { version = "0.7", features = ["serde_json"] }
tracing = "0.1"
rayon = "1.8"
thiserror = "1"
regex = "1.10"
path-slash = "0.2"
alloy-primitives = { version = "0.7", features = ["serde", "rand"] }
cfg-if = "1.0"
dunce = "1.0"
md-5 = "0.10"
yansi = "1.0.1"
memmap2 = "0.9"
once_cell = "1.19"
svm = { package = "svm-rs", version = "0.5", default-features = false }
solang-parser = { version = "=0.3.3", default-features = false }
path-slash = "0.2"
rayon = "1.8"
regex = "1.10"
semver = { version = "1.0", features = ["serde"] }
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1.0"
similar-asserts = "1"
solang-parser = { version = "=0.3.3", default-features = false }
svm = { package = "svm-rs", version = "0.5", default-features = false }
tempfile = "3.9"
thiserror = "1"
tracing = "0.1"
walkdir = "2.5"
yansi = "1.0"

# async
futures-util = "0.3"
Expand Down
19 changes: 9 additions & 10 deletions crates/artifacts/solc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ workspace = true
[dependencies]
foundry-compilers-core.workspace = true

serde.workspace = true
semver.workspace = true
serde_json.workspace = true
tracing.workspace = true
alloy-primitives.workspace = true
alloy-json-abi.workspace = true
alloy-primitives.workspace = true
futures-util = { workspace = true, optional = true }
md-5.workspace = true
rayon.workspace = true
semver.workspace = true
serde_json.workspace = true
serde.workspace = true
thiserror.workspace = true
md-5.workspace = true
yansi.workspace = true
futures-util = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }

walkdir = "2.4"
tracing.workspace = true
walkdir.workspace = true
yansi.workspace = true

[target.'cfg(windows)'.dependencies]
path-slash.workspace = true
Expand Down
12 changes: 6 additions & 6 deletions crates/artifacts/solc/src/ast/lowfidelity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{collections::BTreeMap, fmt, fmt::Write, str::FromStr};

/// Represents the AST field in the solc output
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Ast {
#[serde(rename = "absolutePath")]
pub absolute_path: String,
Expand All @@ -24,7 +24,7 @@ pub struct Ast {
pub other: BTreeMap<String, serde_json::Value>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Node {
/// The node ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -53,16 +53,16 @@ pub struct Node {

impl Node {
/// Deserialize a serialized node attribute.
pub fn attribute<D: DeserializeOwned>(&self, key: impl AsRef<str>) -> Option<D> {
pub fn attribute<D: DeserializeOwned>(&self, key: &str) -> Option<D> {
// TODO: Can we avoid this clone?
self.other.get(key.as_ref()).and_then(|v| serde_json::from_value(v.clone()).ok())
self.other.get(key).and_then(|v| serde_json::from_value(v.clone()).ok())
}
}

/// Represents the source location of a node: `<start byte>:<length>:<source index>`.
///
/// The `length` and `index` can be -1 which is represented as `None`
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct SourceLocation {
pub start: usize,
pub length: Option<usize>,
Expand Down Expand Up @@ -118,7 +118,7 @@ impl fmt::Display for SourceLocation {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum NodeType {
// Expressions
Assignment,
Expand Down
4 changes: 2 additions & 2 deletions crates/artifacts/solc/src/ast/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ macro_rules! ast_node {
}
) => {
$(#[$struct_meta])*
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct $name {
pub id: usize,
Expand Down Expand Up @@ -88,7 +88,7 @@ macro_rules! stmt_node {
/// The inner value of each variant is boxed since AST types are inherently recursive.
macro_rules! node_group {
($group:ident; $( $name:ident ),* $(,)*) => {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "nodeType")]
pub enum $group {
$(
Expand Down
12 changes: 6 additions & 6 deletions crates/artifacts/solc/src/ast/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{fmt, fmt::Write, str::FromStr};
/// Represents the source location of a node: `<start byte>:<length>:<source index>`.
///
/// The `start`, `length` and `index` can be -1 which is represented as `None`
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct SourceLocation {
pub start: Option<usize>,
pub length: Option<usize>,
Expand Down Expand Up @@ -66,7 +66,7 @@ impl fmt::Display for SourceLocation {
}

/// Function mutability specifier.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum StateMutability {
Payable,
Expand All @@ -76,7 +76,7 @@ pub enum StateMutability {
}

/// Variable mutability specifier.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Mutability {
Mutable,
Expand All @@ -85,7 +85,7 @@ pub enum Mutability {
}

/// Storage location specifier.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum StorageLocation {
Calldata,
Expand All @@ -95,7 +95,7 @@ pub enum StorageLocation {
}

/// Visibility specifier.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Visibility {
External,
Expand All @@ -105,7 +105,7 @@ pub enum Visibility {
}

/// A type description.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TypeDescriptions {
pub type_identifier: Option<String>,
Expand Down
Loading

0 comments on commit b0f6fe6

Please sign in to comment.