diff --git a/Makefile b/Makefile index 92a7e84704..9a03eaa0e7 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ rm-test-db: ## 🛑 Removes the DB used by the ethrex client used for testing sudo cargo run --release --bin ethrex -- removedb --force --datadir test_ethrex fixtures/ERC20/ERC20.bin: ## 🔨 Build the ERC20 contract for the load test - solc ./fixtures/contracts/ERC20/ERC20.sol -o $@ + solc --optimize ./fixtures/contracts/ERC20/ERC20.sol -o $@ sort-genesis-files: cd ./tooling/genesis && cargo run diff --git a/crates/l2/sdk/src/sdk.rs b/crates/l2/sdk/src/sdk.rs index 3763811ce9..451abff450 100644 --- a/crates/l2/sdk/src/sdk.rs +++ b/crates/l2/sdk/src/sdk.rs @@ -361,6 +361,7 @@ pub fn compile_contract( // Both the contract path and the output path are relative to where the Makefile is. if !Command::new("solc") + .arg("--optimize") .arg(bin_flag) .arg( "@openzeppelin/contracts=".to_string() diff --git a/crates/l2/tee/contracts/Makefile b/crates/l2/tee/contracts/Makefile index 2228d4f47a..0b6ea36dce 100644 --- a/crates/l2/tee/contracts/Makefile +++ b/crates/l2/tee/contracts/Makefile @@ -42,7 +42,7 @@ lib/openzeppelin-contracts: solc_out/TDXVerifier.bin: src/TDXVerifier.sol lib/openzeppelin-contracts mkdir -p solc_out - solc src/TDXVerifier.sol --bin --allow-paths lib/ -o solc_out/ --overwrite + solc --optimize src/TDXVerifier.sol --bin --allow-paths lib/ -o solc_out/ --overwrite deploy: solc_out/TDXVerifier.bin $(eval CONTRACT_BIN := $(shell cat solc_out/TDXVerifier.bin))