Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions cmd/ethrex/build_l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,28 @@ fn add_with_proxy(
Ok(())
}

fn add_placeholder_proxy(
genesis: &mut Genesis,
address: Address,
out_dir: &Path,
) -> Result<(), SystemContractsUpdaterError> {
let storage: HashMap<U256, U256> = HashMap::from([(
get_erc1967_slot("eip1967.proxy.admin"),
address_to_word(ADMIN_ADDRESS),
)]);

genesis.alloc.insert(
address,
GenesisAccount {
code: Bytes::from(l2_upgradeable_runtime(out_dir)),
storage,
balance: U256::zero(),
nonce: 1,
},
);
Ok(())
}

pub fn update_genesis_file(
l2_genesis_path: &Path,
out_dir: &Path,
Expand All @@ -412,6 +434,10 @@ pub fn update_genesis_file(
out_dir,
)?;

for address in 0xff00..0xfffd {
add_placeholder_proxy(&mut genesis, Address::from_low_u64_be(address), out_dir)?;
}

add_deterministic_deployers(&mut genesis, out_dir);

write_genesis_as_json(genesis, Path::new(l2_genesis_path)).map_err(std::io::Error::other)?;
Expand Down
Loading
Loading