Skip to content

Commit

Permalink
feat: add base-sepolia config (#195)
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Kai <281165273grape@gmail.com>
  • Loading branch information
GrapeBaBa authored Dec 19, 2023
1 parent 6d8d5ad commit 3489998
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions bin/magi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl Cli {
"optimism-sepolia" => ChainConfig::optimism_sepolia(),
"base" => ChainConfig::base(),
"base-goerli" => ChainConfig::base_goerli(),
"base-sepolia" => ChainConfig::base_sepolia(),
file if file.ends_with(".json") => ChainConfig::from_json(file),
_ => panic!(
"Invalid network name. \\
Expand Down
38 changes: 37 additions & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,49 @@ impl ChainConfig {
deposit_contract: addr("0xe93c8cd0d409341205a592f8c4ac1a5fe5585cfa"),
l2_to_l1_message_passer: addr("0x4200000000000000000000000000000000000016"),
max_channel_size: 100_000_000,
channel_timeout: 100,
channel_timeout: 300,
seq_window_size: 3600,
max_seq_drift: 600,
regolith_time: 1683219600,
blocktime: 2,
}
}

pub fn base_sepolia() -> Self {
Self {
network: "base-sepolia".to_string(),
l1_chain_id: 11155111,
l2_chain_id: 84532,
l1_start_epoch: Epoch {
number: 4370868,
hash: hash("0xcac9a83291d4dec146d6f7f69ab2304f23f5be87b1789119a0c5b1e4482444ed"),
timestamp: 1695768288,
},
l2_genesis: BlockInfo {
hash: hash("0x0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4"),
number: 0,
parent_hash: H256::zero(),
timestamp: 1695768288,
},
system_config: SystemConfig {
batch_sender: addr("0x6cdebe940bc0f26850285caca097c11c33103e47"),
gas_limit: U256::from(25_000_000),
l1_fee_overhead: U256::from(2100),
l1_fee_scalar: U256::from(1000000),
unsafe_block_signer: addr("0xb830b99c95Ea32300039624Cb567d324D4b1D83C"),
},
system_config_contract: addr("0xf272670eb55e895584501d564AfEB048bEd26194"),
batch_inbox: addr("0xff00000000000000000000000000000000084532"),
deposit_contract: addr("0x49f53e41452C74589E85cA1677426Ba426459e85"),
l2_to_l1_message_passer: addr("0x4200000000000000000000000000000000000016"),
max_channel_size: 100_000_000,
channel_timeout: 300,
seq_window_size: 3600,
max_seq_drift: 600,
regolith_time: 0,
blocktime: 2,
}
}
}

impl Default for SystemAccounts {
Expand Down
4 changes: 2 additions & 2 deletions src/derive/stages/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ impl TryFrom<Log> for UserDeposited {
.into_bytes()
.unwrap();

let from = Address::try_from(log.topics[1])?;
let to = Address::try_from(log.topics[2])?;
let from = Address::from(log.topics[1]);
let to = Address::from(log.topics[2]);
let mint = U256::from_big_endian(&opaque_data[0..32]);
let value = U256::from_big_endian(&opaque_data[32..64]);
let gas = u64::from_be_bytes(opaque_data[64..72].try_into()?);
Expand Down

0 comments on commit 3489998

Please sign in to comment.