Skip to content

Commit

Permalink
Merge branch 'master' into david/clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuly14 authored Apr 9, 2024
2 parents bc7cf1b + 367675f commit 5846cfa
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 30 deletions.
15 changes: 8 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion binder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ corebc-ylem = { workspace = true, features = ["async", "yvm-ylem", "project-util
corebc-contract = { workspace = true, features = ["abigen"]}
curl = { version = "0.4", default-features = false, features = ["http2"] }
eyre = "0.6"
git2 = { version = "0.17", default-features = false }
git2 = { version = "0.18.3", default-features = false }
url = "2"
tracing = "0.1"
tempfile = "3"
6 changes: 5 additions & 1 deletion 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 = "cb063edadf999cb7b8b3ebc71f5e97783176d289d640", //todo:error2215 change to ce address
default_value = "ce8147e798c3a0d867f70f8785334da06c3418e18ba9",
value_name = "ADDRESS"
)]
deployer: Address,
Expand Down Expand Up @@ -216,6 +216,8 @@ mod tests {
init_code,
"--network",
"1",
"--deployer",
"cb063edadf999cb7b8b3ebc71f5e97783176d289d640"
]);
let create2_out = args.run().unwrap();
let address = create2_out.address;
Expand All @@ -238,6 +240,8 @@ mod tests {
init_code_hash,
"--network",
"1",
"--deployer",
"cb063edadf999cb7b8b3ebc71f5e97783176d289d640"
]);
let create2_out = args.run().unwrap();
let address = create2_out.address;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cmd/probe/estimate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct EstimateArgs {
short,
long,
value_parser = NameOrAddress::from_str,
default_value = "0xcb656dadee521bea601692312454a655a0f49051ddc9", //todo:error2215 change to ce address
default_value = "0xce566dadee521bea601692312454a655a0f49051ddc9",
env = "ETH_FROM",
)]
from: NameOrAddress,
Expand Down
1 change: 1 addition & 0 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@ impl Default for Config {
energy_price: None,
block_coinbase: Config::default_block_coinbase(None), /* todo:error2215 change to ce
* address */
block_coinbase: Config::default_block_coinbase(None),
block_timestamp: 1,
block_difficulty: 0,
block_energy_limit: None,
Expand Down
4 changes: 2 additions & 2 deletions evm/src/executor/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub const CHEATCODE_ADDRESS: H160 = H160([
/// Default cheatcode address
pub fn default_cheatcode_address(mut network: Option<Network>) -> H176 {
if network.is_none() {
network = Some(Network::Private(1337)) //todo:error2215 change to ce address
network = Some(Network::Private(1337))
}
to_ican(&CHEATCODE_ADDRESS, &network.unwrap())
}
Expand All @@ -40,7 +40,7 @@ pub const HARDHAT_CONSOLE_ADDRESS: H160 = H160([
/// Default hardhat console address
pub fn default_hardhat_address(mut network: Option<Network>) -> H176 {
if network.is_none() {
network = Some(Network::Private(1337)) //todo:error2215 change to ce address
network = Some(Network::Private(1337))
}
to_ican(&HARDHAT_CONSOLE_ADDRESS, &network.unwrap())
}
Expand Down
22 changes: 10 additions & 12 deletions evm/src/executor/backend/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ pub enum DatabaseError {
GetTransaction(H256, Arc<eyre::Error>),
#[error("Transaction {0:?} not found")]
TransactionNotFound(H256),
#[error(
"CREATE2 Deployer not present on this chain. [cb063edadf999cb7b8b3ebc71f5e97783176d289d640]"
)]
#[error("CREATE2 Deployer not present on this chain.")]
MissingCreate2Deployer,
#[error(transparent)]
JoinError(#[from] tokio::task::JoinError),
Expand All @@ -59,15 +57,15 @@ impl DatabaseError {
Self::GetFullBlock(_, err) => Some(err),
Self::GetTransaction(_, err) => Some(err),
// Enumerate explicitly to make sure errors are updated if a new one is added.
Self::MissingAccount(_) |
Self::MissingCode(_) |
Self::Recv(_) |
Self::Send(_) |
Self::Message(_) |
Self::BlockNotFound(_) |
Self::TransactionNotFound(_) |
Self::MissingCreate2Deployer |
Self::JoinError(_) => None,
Self::MissingAccount(_)
| Self::MissingCode(_)
| Self::Recv(_)
| Self::Send(_)
| Self::Message(_)
| Self::BlockNotFound(_)
| Self::TransactionNotFound(_)
| Self::MissingCreate2Deployer
| Self::JoinError(_) => None,
}
}

Expand Down
17 changes: 12 additions & 5 deletions evm/src/executor/inspector/cheatcodes/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,25 @@ use std::{collections::VecDeque, str::FromStr};

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

/// Address of the default CREATE2 deployer cb063edadf999cb7b8b3ebc71f5e97783176d289d640
/// Address of the default CREATE2 deployer ce8147e798c3a0d867f70f8785334da06c3418e18ba9
pub const DEFAULT_CREATE2_DEPLOYER: H160 = H160([
0x3e, 0xda, 0xdf, 0x99, 0x9c, 0xb7, 0xb8, 0xb3, 0xeb, 0xc7, 0x1f, 0x5e, 0x97, 0x78, 0x31, 0x76,
0xd2, 0x89, 0xd6, 0x40,
]);

/// Default CREATE2 deployer address
pub fn default_create2_address(mut network: Option<Network>) -> H176 {
if network.is_none() {
network = Some(Network::Private(1337)) //todo:error2215 change to ce address
pub fn default_create2_address(network: Option<Network>) -> H176 {
match network {
Some(Network::Mainnet) => {
return H176::from_str("cb063edadf999cb7b8b3ebc71f5e97783176d289d640").unwrap();
}
Some(Network::Devin) => {
return H176::from_str("ab800ee5e10bfbd37bc647e01d94489b4e244817b07f").unwrap();
}
_ => {
return H176::from_str("ce8147e798c3a0d867f70f8785334da06c3418e18ba9").unwrap();
}
}
to_ican(&DEFAULT_CREATE2_DEPLOYER, &network.unwrap())
}

pub const MAGIC_SKIP_BYTES: &[u8] = b"FOXAR::SKIP";
Expand Down
2 changes: 1 addition & 1 deletion evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub const TEST_CONTRACT_ADDRESS: H160 = H160([
/// Default test contract address
pub fn default_test_contract_address(mut network: Option<Network>) -> H176 {
if network.is_none() {
network = Some(Network::Private(1337)) //todo:error2215 change to ce address
network = Some(Network::Private(1337))
}
to_ican(&TEST_CONTRACT_ADDRESS, &network.unwrap())
}
Expand Down

0 comments on commit 5846cfa

Please sign in to comment.