Clarified usage of CREATE

CREATE was originally intended for gas savings. While one sketch did move to
CREATE2, the security concerns around address collisions (requiring all init
codes not be malleable to achieve security) continue to justify this.

To resolve the gas estimation concerns raised in the prior commit, the
createAddress function has been made constant-gas.
This commit is contained in:
Luke Parker
2025-01-27 07:22:40 -05:00
parent a9625364df
commit ea00ba9ff8
5 changed files with 131 additions and 104 deletions

View File

@@ -32,6 +32,17 @@ fn main() {
&artifacts_path,
)
.unwrap();
// These are detected multiple times and distinguished, hence their renaming to canonical forms
fs::rename(
artifacts_path.clone() + "/Router_sol_Router.bin",
artifacts_path.clone() + "/Router.bin",
)
.unwrap();
fs::rename(
artifacts_path.clone() + "/Router_sol_Router.bin-runtime",
artifacts_path.clone() + "/Router.bin-runtime",
)
.unwrap();
// This cannot be handled with the sol! macro. The Router requires an import
// https://github.com/alloy-rs/core/issues/602
@@ -44,11 +55,16 @@ fn main() {
&(artifacts_path.clone() + "/router.rs"),
);
let test_artifacts_path = artifacts_path + "/tests";
if !fs::exists(&test_artifacts_path).unwrap() {
fs::create_dir(&test_artifacts_path).unwrap();
}
// Build the test contracts
build_solidity_contracts::build(
&["../../../networks/ethereum/schnorr/contracts", "../erc20/contracts", "contracts"],
"contracts/tests",
&(artifacts_path + "/tests"),
&test_artifacts_path,
)
.unwrap();
}