Skip to content

Commit

Permalink
feat: add eip-7251 system contract address/code (alloy-rs#956)
Browse files Browse the repository at this point in the history
* feat: add eip-7251 system contract address/code

* chore: typo

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* chore: nit

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore: fmt

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
  • Loading branch information
3 people authored and ben186 committed Jul 27, 2024
1 parent 3dbc953 commit 33b8b98
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/eips/src/eip7251.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@

#![allow(unknown_lints, non_local_definitions)] // TODO: remove when proptest-derive updates

use alloy_primitives::{Address, FixedBytes};
use alloy_primitives::{address, bytes, Address, Bytes, FixedBytes};
use alloy_rlp::{RlpDecodable, RlpEncodable};

/// The address for the EIP-7251 consolidation requests contract:
/// `0x00b42dbF2194e931E80326D950320f7d9Dbeac02`
pub const CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS: Address =
address!("00b42dbF2194e931E80326D950320f7d9Dbeac02");

/// The code for the EIP-7251 consolidation requests contract.
pub static CONSOLIDATION_REQUEST_PREDEPLOY_CODE: Bytes = bytes!("0f5f395ff33373fffffffffffffffffffffffffffffffffffffffe146098573615156028575f545f5260205ff35b36606014156101445760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061014457600154600101600155600354806004026004013381556001015f35815560010160203581556001016040359055600101600355005b6003546002548082038060011160ac575060015b5f5b81811460f15780607402838201600402600401805490600101805490600101805490600101549260601b84529083601401528260340152906054015260010160ae565b9101809214610103579060025561010e565b90505f6002555f6003555b5f548061049d141561011d57505f5b6001546001828201116101325750505f610138565b01600190035b5f555f6001556074025ff35b5f5ffd");

/// The [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) request type for consolidation requests.
pub const CONSOLIDATION_REQUEST_TYPE: u8 = 0x02;

/// This structure maps onto the consolidation request object from [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, RlpEncodable, RlpDecodable, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down

0 comments on commit 33b8b98

Please sign in to comment.