Skip to content

Commit

Permalink
fix create2 address (#39)
Browse files Browse the repository at this point in the history
* fix create2 address

* revert DEFAULT_CREATE2_DEPLOYER_CODE
  • Loading branch information
error2215 authored Jan 18, 2024
1 parent 52cf63d commit b3080ba
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion abi/src/bindings/hevm.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cli/src/cmd/probe/create2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct Create2Args {
#[clap(
short,
long,
default_value = "cb914e59b44847b379578588920ca78fbf26c0b4956c",
default_value = "cb063edadf999cb7b8b3ebc71f5e97783176d289d640",
value_name = "ADDRESS"
)]
deployer: Address,
Expand Down Expand Up @@ -176,7 +176,7 @@ mod tests {

use super::*;

const DEPLOYER: &str = "cb914e59b44847b379578588920ca78fbf26c0b4956c";
const DEPLOYER: &str = "cb063edadf999cb7b8b3ebc71f5e97783176d289d640";

#[test]
fn basic_create2() {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/cmd/spark/script/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ mod tests {
"foxar-cli",
"Contract.sol",
"--sender",
"cb914e59b44847b379578588920ca78fbf26c0b4956c",
"cb063edadf999cb7b8b3ebc71f5e97783176d289d640",
"--unlocked",
]);
assert!(args.unlocked);
Expand All @@ -740,7 +740,7 @@ mod tests {
"foxar-cli",
"Contract.sol",
"--sender",
"cb914e59b44847b379578588920ca78fbf26c0b4956c",
"cb063edadf999cb7b8b3ebc71f5e97783176d289d640",
"--unlocked",
"--private-key",
key.to_string().as_str(),
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/it/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ sparktest_async!(can_deploy_with_create2, |prj: TestProject, cmd: TestCommand| a
let mut tester = ScriptTester::new_broadcast(cmd, &handle.http_endpoint(), prj.root());

// Prepare CREATE2 Deployer
let addr = Address::from_str("cb914e59b44847b379578588920ca78fbf26c0b4956c").unwrap();
let addr = Address::from_str("cb063edadf999cb7b8b3ebc71f5e97783176d289d640").unwrap();
let code = hex::decode("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3").expect("Could not decode create2 deployer init_code").into();
api.shuttle_set_code(addr, code).await.unwrap();

Expand Down Expand Up @@ -715,7 +715,7 @@ sparktest_async!(
let mut tester = ScriptTester::new_broadcast(cmd, &handle.http_endpoint(), prj.root());

// Prepare CREATE2 Deployer
let addr = Address::from_str("cb914e59b44847b379578588920ca78fbf26c0b4956c").unwrap();
let addr = Address::from_str("cb063edadf999cb7b8b3ebc71f5e97783176d289d640").unwrap();
let code = hex::decode("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3").expect("Could not decode create2 deployer init_code").into();
api.shuttle_set_code(addr, code).await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion evm/src/executor/backend/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub enum DatabaseError {
#[error("Transaction {0:?} not found")]
TransactionNotFound(H256),
#[error(
"CREATE2 Deployer not present on this chain. [cb914e59b44847b379578588920ca78fbf26c0b4956c]"
"CREATE2 Deployer not present on this chain. [cb063edadf999cb7b8b3ebc71f5e97783176d289d640]"
)]
MissingCreate2Deployer,
#[error(transparent)]
Expand Down
6 changes: 3 additions & 3 deletions evm/src/executor/inspector/cheatcodes/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ use std::{collections::VecDeque, str::FromStr};

const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/60'/0'/0/";

/// Address of the default CREATE2 deployer cb914e59b44847b379578588920ca78fbf26c0b4956c
/// Address of the default CREATE2 deployer cb063edadf999cb7b8b3ebc71f5e97783176d289d640
pub const DEFAULT_CREATE2_DEPLOYER: H176 = H176([
203, 145, 78, 89, 180, 72, 71, 179, 121, 87, 133, 136, 146, 12, 167, 143, 191, 38, 192, 180,
149, 108,
0xcb, 0x06, 0x3e, 0xda, 0xdf, 0x99, 0x9c, 0xb7, 0xb8, 0xb3, 0xeb, 0xc7, 0x1f, 0x5e, 0x97, 0x78,
0x31, 0x76, 0xd2, 0x89, 0xd6, 0x40,
]);

pub const MAGIC_SKIP_BYTES: &[u8] = b"FOXAR::SKIP";
Expand Down
4 changes: 2 additions & 2 deletions testdata/repros/Issue3708.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import "../cheats/Cheats.sol";

// https://github.com/foxar-rs/foxar/issues/3708
contract Issue3708Test is DSTest {
// https://optimistic.etherscan.io/address/0xcb914e59b44847b379578588920ca78fbf26c0b4956c#code
// https://optimistic.etherscan.io/address/0xcb063edadf999cb7b8b3ebc71f5e97783176d289d640#code
address constant CREATE2_DEPLOYER =
0xcb914e59b44847b379578588920ca78fbf26c0b4956c;
0xcb063edadf999cb7b8b3ebc71f5e97783176d289d640;
Cheats constant vm = Cheats(HEVM_ADDRESS);

function setUp() public {
Expand Down

0 comments on commit b3080ba

Please sign in to comment.