-
Notifications
You must be signed in to change notification settings - Fork 3
[wip] feat: adds mainnet chain to constants crate #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dylanlott
wants to merge
2
commits into
main
Choose a base branch
from
dylan/mainnet-constants
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| //! Constants for the Mainnet. | ||
|
|
||
| use crate::{ | ||
| HostConstants, HostTokens, HostUsdRecord, RollupConstants, RollupTokens, SignetConstants, | ||
| SignetEnvironmentConstants, SignetSystemConstants, UsdRecords, | ||
| }; | ||
| use alloy::primitives::{address, Address}; | ||
| use std::borrow::Cow; | ||
|
|
||
| /// Name for the host chain. | ||
| pub const HOST_NAME: &str = "Mainnet"; | ||
| /// Chain ID for the Mainnet host chain. | ||
| pub const HOST_CHAIN_ID: u64 = 1; | ||
| /// Deployment height of the rollup on Mainnet host chain. | ||
| pub const DEPLOY_HEIGHT: u64 = 23734244; | ||
| /// `Zenith` contract address for the Mainnet host chain. | ||
| pub const HOST_ZENITH: Address = address!("0xBCe84D45d7be8859bcBd838d4a7b3448B55E6869"); | ||
| /// `Orders` contract address for the Mainnet host chain. | ||
| pub const HOST_ORDERS: Address = address!("0x96f44ddc3Bc8892371305531F1a6d8ca2331fE6C"); | ||
| /// `Passage` contract address for the Mainnet host chain. | ||
| pub const HOST_PASSAGE: Address = address!("0x02a64d6e2c30d2B07ddBD177b24D9D0f6439CcbD"); | ||
| /// `Transactor` contract address for the Mainnet host chain. | ||
| pub const HOST_TRANSACTOR: Address = address!("0xC4388A6f4917B8D392B19b43F9c46FEC1B890f45"); | ||
|
|
||
| /// USDC token for the Mainnet host chain (empty placeholder). | ||
| pub const HOST_USDC: Address = address!("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"); | ||
| /// USDT token for the Mainnet host chain (empty placeholder). | ||
| pub const HOST_USDT: Address = address!("0xdAC17F958D2ee523a2206206994597C13D831ec7"); | ||
| /// WBTC token for the Mainnet host chain (empty placeholder). | ||
| pub const HOST_WBTC: Address = address!("0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"); | ||
| /// WETH token for the Mainnet host chain (empty placeholder). | ||
| pub const HOST_WETH: Address = address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"); | ||
|
|
||
| /// USDC token record for the Mainnet host chain (placeholder name/decimals). | ||
| pub const HOST_USDC_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDC, Cow::Borrowed("USDC"), 6); | ||
| /// USDT token record for the Mainnet host chain (placeholder name/decimals). | ||
| pub const HOST_USDT_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDT, Cow::Borrowed("USDT"), 6); | ||
| /// Host USD records for the Mainnet host chain (empty list by default). | ||
| pub const HOST_USD_RECORDS: UsdRecords = UsdRecords::new(); | ||
| /// Host system tokens for Mainnet (placeholders). | ||
| pub const HOST_TOKENS: HostTokens = HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); | ||
|
|
||
| /// Host system constants for Mainnet. | ||
| pub const HOST: HostConstants = crate::HostConstants::new( | ||
| HOST_CHAIN_ID, | ||
| DEPLOY_HEIGHT, | ||
| HOST_ZENITH, | ||
| HOST_ORDERS, | ||
| HOST_PASSAGE, | ||
| HOST_TRANSACTOR, | ||
| HOST_TOKENS, | ||
| ); | ||
|
|
||
| /// Name for the network. | ||
| pub const RU_NAME: &str = "Signet"; | ||
| /// Chain ID for the Mainnet RU chain. | ||
| pub const RU_CHAIN_ID: u64 = 519; | ||
|
|
||
| /// WETH token for the Mainnet RU chain (placeholder). | ||
| pub const RU_WETH: Address = address!("0x0000000000000000007369676e65742d77657468"); | ||
| /// WBTC token for the Mainnet RU chain (placeholder). | ||
| pub const RU_WBTC: Address = address!("0x0000000000000000007369676e65742d77627463"); | ||
| /// `Orders` contract address for the Mainnet RU chain (placeholder). | ||
| pub const RU_ORDERS: Address = address!("0x000000000000007369676e65742d6f7264657273"); | ||
| /// `Passage` contract address for the Mainnet RU chain (placeholder). | ||
| pub const RU_PASSAGE: Address = address!("0x0000000000007369676e65742d70617373616765"); | ||
| /// The WETH9-based wrapped native USD token contract (placeholder). | ||
| pub const WRAPPED: Address = address!("0x0000000000000000007369676e65742D77757364"); | ||
| /// RU pre-approved system tokens for Mainnet (placeholders). | ||
| pub const RU_TOKENS: RollupTokens = RollupTokens::new(RU_WBTC, RU_WETH); | ||
|
|
||
| /// Base fee recipient address for the Mainnet RU chain (placeholder). | ||
| pub const BASE_FEE_RECIPIENT: Address = address!("0x86Fa9c9fb93C5F6022276db84bf2A05b5a72283E"); | ||
|
|
||
| /// RU system constants for Mainnet. | ||
| pub const ROLLUP: RollupConstants = | ||
| crate::RollupConstants::new(RU_CHAIN_ID, RU_ORDERS, RU_PASSAGE, BASE_FEE_RECIPIENT, RU_TOKENS); | ||
|
|
||
| /// Signet system constants for Mainnet. | ||
| pub const MAINNET_SYS: SignetSystemConstants = crate::SignetSystemConstants::new(HOST, ROLLUP); | ||
|
|
||
| /// Signet environment constants for Mainnet. | ||
| pub const MAINNET_ENV: SignetEnvironmentConstants = SignetEnvironmentConstants::new( | ||
| Cow::Borrowed(HOST_NAME), | ||
| Cow::Borrowed(RU_NAME), | ||
| Cow::Borrowed(TX_CACHE_URL), | ||
| ); | ||
|
|
||
| /// Signet constants for Mainnet. | ||
| pub const MAINNET: SignetConstants = SignetConstants::new(MAINNET_SYS, MAINNET_ENV); | ||
|
|
||
| /// The URL of the Transaction Cache endpoint (empty for mainnet placeholder). | ||
| pub const TX_CACHE_URL: &str = "TODO"; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| pub mod test_utils; | ||
| pub mod mainnet; | ||
|
|
||
| pub mod pecorino; | ||
|
|
||
| pub mod test_utils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing missing is the tx cache url cc @rswanson