Skip to main content

mega_system_contracts/
lib.rs

1//! System contracts for the `MegaETH` EVM.
2//!
3//! This crate provides bytecode constants for system contracts used by mega-evm.
4//! When building from the repository with Foundry installed, the build script validates that
5//! the pre-generated constants match the compiled Solidity source.
6//! When building from a published crate (without Foundry), the pre-generated constants are used
7//! directly.
8
9#![cfg_attr(not(feature = "std"), no_std)]
10#![warn(missing_docs)]
11#![warn(unused_crate_dependencies)]
12#![deny(unused_must_use)]
13
14pub use alloy_primitives;
15
16/// Oracle contract bytecode and interface.
17///
18/// Bytecode constants are pre-generated from the versioned artifacts in the `artifacts/`
19/// directory.
20/// Interface bindings are generated from the Solidity source.
21pub mod oracle {
22    include!("generated/oracle_artifacts.rs");
23
24    alloy_sol_types::sol!("contracts/interfaces/IOracle.sol");
25}
26
27/// `KeylessDeploy` contract bytecode and interface.
28///
29/// Bytecode constants are pre-generated from the versioned artifacts in the `artifacts/`
30/// directory.
31/// Interface bindings are generated from the Solidity source.
32pub mod keyless_deploy {
33    include!("generated/keyless_deploy_artifacts.rs");
34
35    alloy_sol_types::sol!("contracts/interfaces/IKeylessDeploy.sol");
36}
37
38/// `MegaAccessControl` contract bytecode and interface.
39///
40/// Bytecode constants are pre-generated from the versioned artifacts in the `artifacts/`
41/// directory.
42/// Interface bindings are generated from the Solidity source.
43#[allow(missing_docs)]
44pub mod access_control {
45    include!("generated/access_control_artifacts.rs");
46
47    alloy_sol_types::sol!(
48        #[sol(all_derives)]
49        "contracts/interfaces/IMegaAccessControl.sol"
50    );
51}
52
53/// `MegaLimitControl` contract bytecode and interface.
54///
55/// Bytecode constants are pre-generated from the versioned artifacts in the `artifacts/`
56/// directory.
57/// Interface bindings are generated from the Solidity source.
58pub mod limit_control {
59    include!("generated/limit_control_artifacts.rs");
60
61    alloy_sol_types::sol!("contracts/interfaces/IMegaLimitControl.sol");
62}