Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
9 changes: 9 additions & 0 deletions cmd/ethrex/build_l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub fn download_script() {
&output_contracts_path.join("lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol"),
"ERC1967Proxy",
false,
false,
None,
&[&output_contracts_path]
);
Expand All @@ -58,6 +59,7 @@ pub fn download_script() {
.join("lib/sp1-contracts/contracts/src/v5.0.0/SP1VerifierGroth16.sol"),
"SP1Verifier",
false,
false,
None,
&[&output_contracts_path],
);
Expand All @@ -72,6 +74,7 @@ pub fn download_script() {
&output_contracts_path.join("lib/create2deployer/contracts/Create2Deployer.sol"),
"Create2Deployer",
true,
false,
Some(&remappings),
&[contracts_path],
);
Expand Down Expand Up @@ -107,6 +110,7 @@ pub fn download_script() {
path,
name,
false,
false,
Some(&remappings),
&[contracts_path],
);
Expand Down Expand Up @@ -136,6 +140,7 @@ pub fn download_script() {
path,
name,
true,
false,
Some(&remappings),
&[contracts_path],
);
Expand All @@ -147,13 +152,15 @@ pub fn download_script() {
Path::new("../../crates/l2/contracts/src/l1/based/SequencerRegistry.sol"),
"SequencerRegistry",
false,
false,
Some(&remappings),
&[contracts_path],
);
ethrex_l2_sdk::compile_contract(
&output_contracts_path,
Path::new("../../crates/l2/contracts/src/l1/based/OnChainProposer.sol"),
false,
false,
Some(&remappings),
&[contracts_path],
)
Expand Down Expand Up @@ -235,6 +242,7 @@ fn compile_contract_to_bytecode(
contract_path: &Path,
contract_name: &str,
runtime_bin: bool,
abi_json: bool,
remappings: Option<&[(&str, PathBuf)]>,
allow_paths: &[&Path],
) {
Expand All @@ -243,6 +251,7 @@ fn compile_contract_to_bytecode(
output_dir,
contract_path,
runtime_bin,
abi_json,
remappings,
allow_paths,
)
Expand Down
1 change: 1 addition & 0 deletions crates/l2/sdk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn main() {
&contracts_path,
&proxy_contract_path,
false,
false,
None,
&[&contracts_path],
)
Expand Down
5 changes: 5 additions & 0 deletions crates/l2/sdk/contract_utils/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn compile_contract(
output_dir: &Path,
contract_path: &Path,
runtime_bin: bool,
abi_json: bool,
remappings: Option<&[(&str, PathBuf)]>,
allow_paths: &[&Path],
) -> Result<(), ContractCompilationError> {
Expand All @@ -27,6 +28,10 @@ pub fn compile_contract(
let mut cmd = Command::new("solc");
cmd.arg(bin_flag);

if abi_json {
cmd.arg("--abi");
}

apply_remappings(&mut cmd, remappings)?;

cmd.arg(
Expand Down
3 changes: 3 additions & 0 deletions crates/l2/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ async fn test_upgrade(l1_client: EthClient, l2_client: EthClient) -> Result<Fees
contracts_path,
Path::new("contracts/src/l2/CommonBridgeL2.sol"),
false,
false,
Some(&remappings),
&[contracts_path],
)?;
Expand Down Expand Up @@ -561,6 +562,7 @@ async fn test_erc20_roundtrip(
contracts_path,
&contracts_path.join("src/example/L2ERC20.sol"),
false,
false,
Some(&remappings),
&[contracts_path],
)?;
Expand Down Expand Up @@ -2019,6 +2021,7 @@ async fn test_fee_token(
fee_token_path,
&fee_token_path.join("FeeToken.sol"),
false,
false,
Some(&remappings),
&allow_paths,
)?;
Expand Down
Loading